K
knoak
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.attachEvent) {
window.attachEvent('onload', goNL());
} else if (window.addEventListener) {
window.addEventListener("load", goNL(), false);
} else {
window.onload = goNL();
};
function goNL(){
document.getElementById('en').style.display = "none"
document.getElementById('de').style.display = "none"
document.getElementById('nl').style.display = "inline"
};
When i call goNL() bij link <a href="javascript: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.attachEvent) {
window.attachEvent('onload', goNL());
} else if (window.addEventListener) {
window.addEventListener("load", goNL(), false);
} else {
window.onload = goNL();
};
function goNL(){
document.getElementById('en').style.display = "none"
document.getElementById('de').style.display = "none"
document.getElementById('nl').style.display = "inline"
};
When i call goNL() bij link <a href="javascript:goNL()">link</a> it works,
but why won't it work by itself????
Please lend me a hand!
Thanks & Greetings Knoak