T
throwaway_addr_12345
OK, looked at the faq, went to faqts.com (discovered irt.org ain't
there and webdeveloper.com is
hung, but nil else), read every blessed thing I could find on events
and handlers at quirksmode
(superior site!) and webbasedprogramming.com (also informative) and
even checked moz for
gecko thingies (no help).
I gather I'm just too stoopid to write Js code. The snippet below hangs
when I touch the
"sayfoo/saybar" area, trying to load something. The javascript console
says nothing.
Nowhere does anybody say "you can't call document.write()" from inside
a mouse event handler. So much for putting print statements in your
code as a debugging tool, eh?
Nobody said you can't do stuff inside a span element, either.
So, what's up? Did someone forget to say "an interactive event handler
is a response to an asynchronous interrupt and certain I/O operations
are (only partially) masked thereby cratering your code", or is
something else afoot, like "G**d**mnned beginners can't figure
anything out!"?
Humbly, "Inquiring minds are dying to know..."
Ref: NS7.2 on Windoze XP.
<html>
<head>
<script type="text/javascript">
function gocyan() {
document.bgColor='cyan';
return false;
}
function gored() {
document.bgColor='red';
return false;
}
function lert1() {
alert("OK, the mouseover lerty thing works");
return false;
}
function sayfoo() {
document.write("foo on you");
return false; /* true doesn't help */
}
function saybar() {
document.write("stop that!");
return false;
}
function x_func() {
document.write('<p>This works...<span
id="cafeamericain">gocyan/gored</span><p>')
elem1=document.getElementById('cafeamericain')
elem1.onmouseover = gocyan;
elem1.onmouseout = gored;
document.write('<p>And this works...<span id="ingrid">gimme a
lert</span><p>')
elem2=document.getElementById('ingrid')
elem2.onmouseover = lert1;
document.write('<p>But this is weeeird...<span
id="ginjoints">sayfoo/saybar</span><p>')
elem3=document.getElementById('ginjoints')
elem3.onmouseover = sayfoo;
elem3.onmouseout = saybar;
}
</script>
</head>
<body>
<script type="text/javascript">
document.write("I'm gonna tear out my hair...<p>")
x_func()
document.write("one at a time.")
</script>
</body>
</html>
there and webdeveloper.com is
hung, but nil else), read every blessed thing I could find on events
and handlers at quirksmode
(superior site!) and webbasedprogramming.com (also informative) and
even checked moz for
gecko thingies (no help).
I gather I'm just too stoopid to write Js code. The snippet below hangs
when I touch the
"sayfoo/saybar" area, trying to load something. The javascript console
says nothing.
Nowhere does anybody say "you can't call document.write()" from inside
a mouse event handler. So much for putting print statements in your
code as a debugging tool, eh?
Nobody said you can't do stuff inside a span element, either.
So, what's up? Did someone forget to say "an interactive event handler
is a response to an asynchronous interrupt and certain I/O operations
are (only partially) masked thereby cratering your code", or is
something else afoot, like "G**d**mnned beginners can't figure
anything out!"?
Humbly, "Inquiring minds are dying to know..."
Ref: NS7.2 on Windoze XP.
<html>
<head>
<script type="text/javascript">
function gocyan() {
document.bgColor='cyan';
return false;
}
function gored() {
document.bgColor='red';
return false;
}
function lert1() {
alert("OK, the mouseover lerty thing works");
return false;
}
function sayfoo() {
document.write("foo on you");
return false; /* true doesn't help */
}
function saybar() {
document.write("stop that!");
return false;
}
function x_func() {
document.write('<p>This works...<span
id="cafeamericain">gocyan/gored</span><p>')
elem1=document.getElementById('cafeamericain')
elem1.onmouseover = gocyan;
elem1.onmouseout = gored;
document.write('<p>And this works...<span id="ingrid">gimme a
lert</span><p>')
elem2=document.getElementById('ingrid')
elem2.onmouseover = lert1;
document.write('<p>But this is weeeird...<span
id="ginjoints">sayfoo/saybar</span><p>')
elem3=document.getElementById('ginjoints')
elem3.onmouseover = sayfoo;
elem3.onmouseout = saybar;
}
</script>
</head>
<body>
<script type="text/javascript">
document.write("I'm gonna tear out my hair...<p>")
x_func()
document.write("one at a time.")
</script>
</body>
</html>