crw150
Technical User
- May 27, 2005
- 20
Hi,
I'm a javascript novice and have searched for days but am still lost. The code below is supposed to load an external .js file depending on the browser in use. It works fine for IE and Firefox. But it Netscape 7 it only loads the css file, not the .js file. I've tried all the variations I could find (like using "language" attribute instead of "type" attribute, breaking the word "script" with a + sign, etc.) but still no luck. What is the correct command and syntax to use to get Netscape 7 to load an external .js file? Please tell me what's wrong, or point me to a web site or tutorial, or tell me what key words to use for searching. Any help will be greatly appreciated!
CRW
(The reDo function is for another purpose, but I'm showing complete script as is in case that's an issue.)
I'm a javascript novice and have searched for days but am still lost. The code below is supposed to load an external .js file depending on the browser in use. It works fine for IE and Firefox. But it Netscape 7 it only loads the css file, not the .js file. I've tried all the variations I could find (like using "language" attribute instead of "type" attribute, breaking the word "script" with a + sign, etc.) but still no luck. What is the correct command and syntax to use to get Netscape 7 to load an external .js file? Please tell me what's wrong, or point me to a web site or tutorial, or tell me what key words to use for searching. Any help will be greatly appreciated!
CRW
(The reDo function is for another purpose, but I'm showing complete script as is in case that's an issue.)
Code:
<script type="text/javascript">
<![CDATA[
if (document.getElementById) {
document.write('<script type="text/javascript" src="file:///C:/Menus/jsdropdown/indexFiles/ie.js"><\/script>');
}
else {
document.write("<link rel='stylesheet' href='file:///C:/WbDesign/Stylesheets/nn.css' type='text/css'>");
document.write('<script type="text/javascript" src="file:///C:/Menus/jsdropdown/indexFiles/nn.js"><\/script>');
}
function reDo(){ location.reload() }
window.onresize = reDo;
]]>
</script>