Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RE: Problem with Javascript in Netscape 4.75 1

Status
Not open for further replies.

garymgordon

Programmer
Apr 5, 2000
307
0
0
US
I am having a problem with the following.

I created a drop down menu in html as:

<select style=&quot;width: 250px; font-size: 9pt;&quot; onchange=&quot;location=options[selectedIndex].value;&quot;>
<option value=&quot;javascript:void(0);&quot; selected=&quot;selected&quot;>GO TO: &nbsp; Department Websites</option>
<option value=&quot;websites/site1/index.html&quot;>&gt; Main Website</option>
</select>

and I converted it to Javascript as:

<!--
document.writeln(&quot;<select style=\&quot;width: 250px; font-size: 9pt;\&quot; onchange=\&quot;location=options[selectedIndex].value;\&quot;>&quot;);
document.writeln(&quot;<option value=\&quot;javascript:void(0);\&quot; selected=\&quot;selected\&quot;>GO TO: &nbsp; Department Websites</option>&quot;);
document.writeln(&quot;<option value=\&quot;websites/site1/index.html\&quot;>&gt; Main Website</option>&quot;);
document.writeln(&quot;</select>&quot;);
//-->

The above Javascript file will be imported into an html page using ...

<script type=&quot;text/javascript&quot; language=&quot;javascript&quot; src=&quot;/js/menu.js&quot;></script>

[NOTE: I have placed the <form> and </form> tags around the outside of the imported .js file.]

When I do this in IE6 or Netscape 6, I have no problem at all.

But when I use the above .. in Netscape 4.75 I don't get the SELECT drop down menu, all I get is the text that says:

GO TO: Department Websites>Main Website

That's what shows up in Netscape 4.75.

When I look at the source code .. it looks like it brought everything in fine.

Basically, I need to create this menu in a single file (without using SSI or ASP) and import it into multiple HTML pages so I can change the menu in one place and have it appear on multiple other pages.

Again, in IE6 and Netscape 6 it works fine.

I can't seem to figure out why Netscape 4.75 is giving me a problem.

NOTE ... If I put the code of:

<select style=&quot;width: 250px; font-size: 9pt;&quot; onchange=&quot;location=options[selectedIndex].value;&quot;>
<option value=&quot;javascript:void(0);&quot; selected=&quot;selected&quot;>GO TO: &nbsp; Department Websites</option>
<option value=&quot;websites/site1/index.html&quot;>&gt; Main Website</option>
</select>

directly into the HTML page and then try to open the page in Netscape 4.75 .. everything is fine.

The problem only exists when I try to bring that information in and place it in the HTML page using the .js file.

I could really appreciate some expert help with this problem. It is driving me crazy. hahaha

Thanks in advance,
Gary
ggordon@garymgordon.com


Gary M. Gordon, LLC
webmaster@garymgordon.com
Certified Web Developer ::
Application Programmer
 
Xutopia,

Because .. we support Netscape 4.* and IE 5.*

So, simply put, I just need to make sure it works in these browsers.

Any idea what might be causing the problem???

Gary
Gary M. Gordon, LLC
webmaster@garymgordon.com
Certified Web Developer ::
Application Programmer
 
Maybe :

<select style=&quot;width: 250px; font-size: 9pt;&quot; onchange=&quot;location=this.options[this.selectedIndex].value;&quot;>

Just trowing stuff at you here. Really though NS4 sucks and should be dropped. Make the argument to whoever is in charge ot the project that it costs more to develop for NS4 because of all the extra time trying to make it work.

Gary Haran
==========================
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top