0

I have read in several write-ups that jquery can facilitate event listening on an iframe - for EACH reload.

I'm only getting the initial event notice - all subsequent reloads events are silent/ignored.

Code sample:

$('#some_frame_id').bind('load', modNamespace.eHandler());

However, if I drop back to the now-seemingly-frowned-upon onLoad syntax, I get the expected results - using the same handler:

iframe(class='foo'src='/path/to/resource' id='some_frame_id' name-'some_frame_id' onload='modNamespace.eHandler();')

This gets me the results that I'm looking for but I'd still like to understand the problem with my jQuery implementation.

(note: the iframe markup is Jade)

mjk
  • 659
  • 1
  • 9
  • 20
  • 1
    This should help you: http://stackoverflow.com/questions/5788499/jquery-iframe-load-event – Joe Apr 19 '13 at 23:51
  • I saw that one earlier but I wasn't able to extract how it fit my particular case - that seems to be alluding that the ideal way is an embedded solution which would force all iframe-d content to notify the containing window. Maybe I've misunderstood the jquery solution and it is only intended to sit "within" the iframe, rather than monitoring it from the parent? – mjk Apr 20 '13 at 00:05

0 Answers0