This project is archived and is in readonly mode.

#296 ✓resolved
Sebastian Markbåge

IFrame load event doesn't fire in Firefox 3 patch

Reported by Sebastian Markbåge | August 5th, 2008 @ 12:55 AM | in 1.2.3

General issue:

var f = new IFrame('id', { onload: function() { alert('loaded'); } });

If this is issued after the frame 'id' already has loaded, the onload function won't trigger in Firefox 3.

The same applies in all browsers with the recommended property syntax:

var f = new IFrame('id', { events: { load: function() { alert('loaded'); } } });

To replicate, run the code at the onload event, after all iframes in the document have been loaded.

Discussion:

I'll leave it to someone else to argue if { events: { load } } should trigger if the iframe has already been loaded. However, the onload alternative should be consistent in all browsers.

Technical details:

The extension of the native IFrame uses window.frames['name'] to check if the frame has already been loaded. This doesn't work in Firefox 3 as window.frames only accepts indexes. Instead it returns undefined and therefore the code assumes that the frame is not yet loaded.

Solution:

?? You could iterate the values in window.frames and check the name property of these against the iframe name property. Hardly an optimal solution though.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Shared Ticket Bins

People watching this ticket

Attachments

Pages