Hi there,
I have a php-generated page which can have a variety of layouts, depending
on a lot of things. But every layout has the same <head> and <body>
so i cannot put an onload in the <body> tag.
My problem:
I use the following code inside the body, which should be cross-browser:
if (window.attachE vent) {
window.attachEv ent('onload', goNL());
} else if (window.addEven tListener) {
window.addEvent Listener("load" , goNL(), false);
} else {
window.onload = goNL();
};
function goNL(){
document.getEle mentById('en'). style.display = "none"
document.getEle mentById('de'). style.display = "none"
document.getEle mentById('nl'). style.display = "inline"
};
When i call goNL() bij link <a href="javascrip t:goNL()">link</a> it works,
but why won't it work by itself????
Please lend me a hand!
Thanks & Greetings Knoak
I have a php-generated page which can have a variety of layouts, depending
on a lot of things. But every layout has the same <head> and <body>
so i cannot put an onload in the <body> tag.
My problem:
I use the following code inside the body, which should be cross-browser:
if (window.attachE vent) {
window.attachEv ent('onload', goNL());
} else if (window.addEven tListener) {
window.addEvent Listener("load" , goNL(), false);
} else {
window.onload = goNL();
};
function goNL(){
document.getEle mentById('en'). style.display = "none"
document.getEle mentById('de'). style.display = "none"
document.getEle mentById('nl'). style.display = "inline"
};
When i call goNL() bij link <a href="javascrip t:goNL()">link</a> it works,
but why won't it work by itself????
Please lend me a hand!
Thanks & Greetings Knoak
Comment