Scripts & Paths in index.htm

Hosted by Ruth, this section is for those brand new to the menu. We won't teach you HTML, but we will help get your menu experience off to a good start.
Locked
User avatar
Maz
Milonic God
Milonic God
Posts: 1717
Joined: Fri Jun 06, 2003 11:39 pm
Location: San Francisco
Contact:

Scripts & Paths in index.htm

Post by Maz »

When you first download and open index.htm in your browser you will see the active menu.

The scripts in index.htm to be placed on your website are:

Code: Select all


<SCRIPT language=JavaScript src="milonic_src.js" type=text/javascript></SCRIPT>	
<script	language=JavaScript>
if(ns4)_d.write("<scr"+"ipt language=JavaScript src=mmenuns4.js><\/scr"+"ipt>");		
  else _d.write("<scr"+"ipt language=JavaScript src=mmenudom.js><\/scr"+"ipt>"); 
</script>

<SCRIPT language=JavaScript src="menu_data.js" type=text/javascript></SCRIPT>

Place these under the <body> tag.

Always make sure milonic_src.js is the first script and don't change the names of milonic_src.js, mmenuns4.js, mmenudom.js.

These are the files you upload to your directory, but do not change them in any way.

You will be making changes to the file menu_data.js and if you decide to change the name of the file make sure you change the script name here too.

Paths

If your website is

Code: Select all

www.mywebsite.com/
and you place the menu in the public directory in a new folder called "menu"
Then the path would be:
/menu/

In this example the script paths above now need to be changed to:
"/menu/milonic_src.js"
/menu/mmenuns4.js
/menu/mmenudom.js
"/menu/menu_data.js"

If images are in a folder inside the menu folder, then image paths in menu_data.js need to be changed too:
"/menu/images/arrow.gif";

You can place the menu files anywhere provided the paths are correct from your websites root directory.

XHTML
XHTML will not validate unless scripts are hidden using CDATA.
Here is an example:

Code: Select all


<SCRIPT language=JavaScript src="milonic_src.js" type=text/javascript></SCRIPT>
<script language="javascript" type="text/javascript">
//<![CDATA[
if(ns4)_d.write("<scr"+"ipt language=JavaScript src=mmenuns4.js><\/scr"+"ipt>");		
  else _d.write("<scr"+"ipt language=JavaScript src=mmenudom.js><\/scr"+"ipt>");
//]]>
</script>
<SCRIPT language=JavaScript src="menu_data.js" type=text/javascript></SCRIPT>

Locked