I just added a script to my site that has a progress bar that loads certain images. However the script says to put <script language="javascript" src="js/progressbar_index.js"> /* Preload Image */ </script> HTML: into the HEAD of my page, however it doesn't seem to work. I then added it into directly under the <body> and it works fine but now my sign in box doesn't automatically load the cursor. onLoad="self.focus();document.SignIn.username.focus()" Does anyone know how i could get the two scripts working together please
Hey, I might not be able to track down the EXACT problem but hear me out. I know nothing about your scripts so the only thing I can say is that onLoad is very useful for running after everything has loaded (duh). The reason its so useful is that if you have something like menuItem1 = document.getElementById('menuItem1'); then if it wasn't called in onLoad but was called in head (which was before any of the actual html stuff), it will give you an error. This is because the id 'menuItem1' does not exist yet since your JavaScript is called too soon (before the HTML is parsed). Also, <script type="text/javascript" SRC="SCRIPT.SRC">Code here</script>...this will not work because you are instead calling for an external javascript file...You cannot add code in between then...On second thought, this might work, if it does let me know Ed