Forum Moderators: open

Message Too Old, No Replies

document.write for menu selection

This technique works on my PC but not when it is on a web site

         

pops

6:02 pm on Aug 17, 2005 (gmt 0)

10+ Year Member



I found a javascript that allows me to use a drop down list for a menu. I have worked on programming languages that allow include statements so I tried to use a similar technique using JavaScript with document.write. I was hoping that I would only have the menu stored once and then when I added pages I would only have one place to change and my whole web site would be updated. It works fine on my PC but not on my web site. Maybe someone can tell me what is wrong?

There are two scripts: jumpPage and Menu which are stored in my javascript folder.
It is the Menu script that contains the document.write code
I hope that there is a way to somehow use this technique.

[edited by: jatar_k at 9:21 pm (utc) on Aug. 17, 2005]
[edit reason] no personal urls thanks [/edit]

kaled

8:25 pm on Aug 17, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You should change your script as follows (but what you have probably is ok).

function jumpPage(newLoc) {
var newPage = newLoc.options[newLoc.selectedIndex].value;
if (newPage) window.location.href = newPage;
}

menu.js is not found on your server!

Also note, TOS don't allow personal urls.

Kaled.

pops

8:40 pm on Aug 17, 2005 (gmt 0)

10+ Year Member



Hi Kaled,
Thank you, the solution was easy. When you told me that menu.js wasn't on my server that was my key. It was but it was Menu.js the upper case M. Now it works fine. I have a question for you. What does TOS stand for? You said note TOS don't allow personal urls. Who or what is TOS?

Thank you again for your quick reply.

kaled

11:12 pm on Aug 17, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



TOS = Terms Of Service ie the forum's rules.

To view the rules, open a reply page and click the link labelled "posting guidelines".

Kaled.