<body onload="toggleLayer('adivname')">
^^This was working, then I went to it, and BOOM! It was broken. IE6 + 7 are both not making it go.
Is there something wrong?
-
-
seems not to work either - works in ff though...
-
Where is that function located? If it's in a code-behind, you can move it to the Page_Load event. If it's in a script, consider moving the trigger to another tag (i.e. <html>).
-
SlackmasterK wrote:Where is that function located? If it's in a code-behind, you can move it to the Page_Load event. If it's in a script, consider moving the trigger to another tag (i.e. <html>).
Seems like JavaScript to me. Weird that the thing is not fired... -
W3bbo wrote: body = document.getElementsById("body");
Well, that will rather obviously not work. For one thing, there is no function getElementsById (that's a typo I suspect) and two, the body element does not have the id body. You were probably thinking about document.getElementsByTagName, but there's an even easier way: simply use document.body (this is a DOM level 1 attribute, so it should work in all browsers). -
Sven Groot wrote:

W3bbo wrote: body = document.getElementsById("body");
Well, that will rather obviously not work. For one thing, there is no function getElementsById (that's a typo I suspect) and two, the body element does not have the id body. You were probably thinking about document.getElementsByTagName, but there's an even easier way: simply use document.body (this is a DOM level 1 attribute, so it should work in all browsers).
Whops! I wasn't thinking, sorry.
-
anthq11 wrote:
<body onload="toggleLayer('adivname')">
^^This was working, then I went to it, and BOOM! It was broken. IE6 + 7 are both not making it go.
Is there something wrong?
Try this instead:
<head>
<script type="text/javascript">
var body;
window.onload = function() {
body = document.getElementsById("body");
body.onload = toggleLayer('adivname');
}
</script>
</head>
<body>
</body>
So much cleaner.
EDIT: Ignore this post, script es b0rked!
Thread Closed
This thread is kinda stale and has been closed but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.