Tell a Friend About Our Cool Software
<img src="images/home.gif" WIDTH="100" HEIGHT="30">
The src="some image" tells the browser where to look for the image. The src= is looking for an image called "home.gif" in a folder called "images". This is known as a relative reference. The image is defined relative to the HTML page that contains the link. For example, if HTML the file is:
http://www.myweb.com/my_folder/index.html
then the browser will look for the file in
http://www.myweb.com/my_folder/images/home.gif
When you upload the file from your PC to your Web host, you must also upload the image file to the correct folder on your Web host.
In order to create the JS file, you will need to paste all the DHTML code that is inside the <SCRIPT> </SCRIPT> tags into a blank file HTML file and use Save As... to change the file extension to .js instead of .html. This means you do not want <SCRIPT LANGUAGE="javascript" SRC="javascript/dhtml_menu.js"></SCRIPT> in your JS file. You also do not want any other HTML, only the code between here <SCRIPT> and here </SCRIPT>.
External JS files work in the same way except the tag to link to them is slightly different. Take a look again:
<SCRIPT LANGUAGE="javascript" SRC="javascript/dhtml_menu.js"></SCRIPT>
The thing to note is there is an opening <SCRIPT> tag and a closing </SCRIPT> tag. It is very important you do not miss the closing tag, as anything between the <SCRIPT> and </SCRIPT> tag will be ignored by the browser.
<SCRIPT LANGUAGE="javascript" SRC="javascript/dhtml_menu.js"> This is ignored </SCRIPT>This is why the closing </SCRIPT> tag is important. If you forget it, you could end up with nothing at all appearing in your page. In the above link there is LANGUAGE="javascript", which tells the browser to interpret the text in the file as JavaScript functions (as opposed to, say, VBScript). You do not have to use the name JavaScript for the folder. For example, <SCRIPT LANGUAGE="javascript" SRC="my_scripts/dhtml_menu.js"></SCRIPT> will look for the file "dhtml_menu.js" in the folder "my_scripts". Again the references are relative, so if your page that contains the link is at
http://www.myweb.com/my_folder/index.htmlThen the browser will look for the file in
http://www.myweb.com/my_folder/my_scripts/dhtml_menu.jsJust like for images, when you upload a file from your PC to your Web host, you must upload the JS file to the correct folder as well.
Free DHTML Menu Builder Help Index | Free DHTML Menu Builder Homepage