#390 closed bug (fixed)
Can't attach IFrame's load event/IE7
Reported by: | Andrey Skvortsov | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 1.1.3 |
Component: | event | Version: | 1.1a |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description (last modified by )
Try:
var d= document.createElement( "iframe"); $(d).load( function(){alert("ok");}); d.src=""; document.body.appendChild(d);
$(d).bind(...) dosen't work too.
but standard d.attachEvent("onload",...) works fine.
Change History (8)
comment:1 Changed 16 years ago by
Component: | ajax → event |
---|---|
Version: | 1.0 |
comment:2 Changed 16 years ago by
Milestone: | → 1.1 |
---|---|
Version: | → 1.1 |
comment:3 Changed 16 years ago by
comment:4 Changed 16 years ago by
Description: | modified (diff) |
---|
comment:5 Changed 16 years ago by
I have noticed, in FF 2.0, that attaching events to new windows that load content from a different domain (for example, http://mysite.com has a link that uses window.open() to load http://www.yahoo.com) is pretty much impossible because of the "same origin policy"(1). Perhaps this is related?
(1) http://www.mozilla.org/projects/security/components/same-origin.html
comment:6 Changed 16 years ago by
need: | → Test Case |
---|
comment:8 Changed 16 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
With the move to DOM Level 2 event handlers in the latest SVN this is now resolved as much as possible.
Note: See
TracTickets for help on using
tickets.
Just a few notes from some investigations.
The onload event actually belongs to the window object, not the document object; document.onload is an alias for window.onload.
There was this curious comment in jQuery.event.add but d.setInterval==undefined for this case and it may be unrelated anyway:
I tried a few other methods, each one by itself to prevent interference; one or both were broken on either IE7 or FF2:
That's as far as I could get.