[X-posted to the ruby-on-rails-spinoffs mailing list...]
JavaScripters:
Steps to reproduce the bug:
Save this in "outer.html ":
<div id='updateMe'></div>
<iframe src='inner.html '/>
Now save this into "inner.html ":
<input type='button' value='control'
onclick="window .parent.locatio n.href =
"javascrip t:void(document .getElementById ('updateMe').in nerHTML
= 'control')" ;"/>
<script src="/javascripts/prototype.js?11 68956448"
type="text/javascript"></script>
<input type='button' value='experime nt'
onclick="window .parent.locatio n.href =
"javascrip t:void($('updat eMe').innerHTML =
'experiment')&q uot;"/>
Surf Internet Explorer (7 BTW) to outer.html, and observe two buttons.
Click 'control', and observe that the outer.html's div updates to 'control'.
Observed behavior:
Click 'experiment', and observe a null-object crash. $() could not find the
same value as getElementById( ).
Expected behavior:
Because the javascript:void trick evaluates in the context of the target
frame (not the source frame), the behaviors of $() and getElementById( )
should be exactly the same inside the javascript:void () line as inside the
target frame, right?
(BTW I suspect from related evidence that the code "works" in Firefox...)
--
Phlip
http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!!