Hello,
I've written--what should have been--a small simple script...if getElementById, then xzy, else abc. The then, else portion calls a doc.write which scripts a js-include. For testing purposes, the called includes are simple alert-messages.
The script runs fine, error free, and the js-includes are scripted--and the alerts fire.
The problem is: I get no page back after OK-ing the alert-msg; I'm left with a blank--nothing but white...the content of my page does not come back into view. The blank problem occurs in all browsers. I'm sure the solution is simple, but I'm not developer enough to figure-it-out.
Here's the code:
if (navigator.cookieEnabled != 0) {
if (document.getElementById) {
onload = function() {
myThing();
}
}
function myThing() {
var js = document.getElementById('jsOn');
if (document.getElementById) {
if (js.style.visibility != 'hidden') {
jsLaunch('~JS/jsLaunch.js');
}
else {
jsToggle('~JS/jsToggle.js');
}
}
}
}
function jsLaunch(url) {
if (!document.layers) {
document.write('<script src="', url, '" type="text/javascript"><\/script>');
}
}
function jsToggle(url) {
if (!document.layers) {
document.write('<script src="', url, '" type="text/javascript"><\/script>');
}
}
If someone can spot the problem, please inform me.
Thank you,
Nunajer