peterinwa
07-15-2004, 05:33 AM
// Conditionally load .js file
v=getCookie("listNumCookie");
if (v==101){document.write("<" + "script src='list_misc.js'><" + "/script>")} // defines var misc
if (v==102){document.write("<" + "script src='list_dairy.js'><" + "/script>")} // defines var dairy
if (v==101){c=misc}
if (v==102){c=dairy}
alert(c);
The alert is saying undefined. I can't figure out why because I am sure the .js file is being loaded. I say this because I can put some illegal code in the .js file and get an error message about it.
This code in is just one of many Frames, but I don't see what difference that would make as I'm loading the .js file into this frame.
Thanks, Peter
v=getCookie("listNumCookie");
if (v==101){document.write("<" + "script src='list_misc.js'><" + "/script>")} // defines var misc
if (v==102){document.write("<" + "script src='list_dairy.js'><" + "/script>")} // defines var dairy
if (v==101){c=misc}
if (v==102){c=dairy}
alert(c);
The alert is saying undefined. I can't figure out why because I am sure the .js file is being loaded. I say this because I can put some illegal code in the .js file and get an error message about it.
This code in is just one of many Frames, but I don't see what difference that would make as I'm loading the .js file into this frame.
Thanks, Peter