2
2obvious
This is nice and simple:
Below is a code example. On a PC, it works in IE6. It does not work
in Netscapes 6 or 7. Why?
<html><head>
<script>
function test()
{
document.getElementById("blah").style.color = "green";
}
if ( window.attachEvent )
window.attachEvent("onload", test);
</script>
</head><body>
<h1 id="blah">Test</h1>
</body></html>
In more depth: I am trying to test my ability to set styles from
inside functions on Netscape. The situation that inspired my example
code worked in NN7 but not NN6. I'm noticing that my example,
however, works in neither.
I'd sure like to know why. Bad syntax on my part? Bugs in Netscape?
A way to make it work? Thanks.
Below is a code example. On a PC, it works in IE6. It does not work
in Netscapes 6 or 7. Why?
<html><head>
<script>
function test()
{
document.getElementById("blah").style.color = "green";
}
if ( window.attachEvent )
window.attachEvent("onload", test);
</script>
</head><body>
<h1 id="blah">Test</h1>
</body></html>
In more depth: I am trying to test my ability to set styles from
inside functions on Netscape. The situation that inspired my example
code worked in NN7 but not NN6. I'm noticing that my example,
however, works in neither.
I'd sure like to know why. Bad syntax on my part? Bugs in Netscape?
A way to make it work? Thanks.