• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 535
  • Last Modified:

With jQuery can I fire a function when an iframes src="" changes?

I have a page with an iframe. I want jQuery to watch the iFrame and when the src of the iframe changes it should fire a function.

Also is there a way to tell when the iframe completes loading?
0
TotallyMe
Asked:
TotallyMe
  • 3
1 Solution
 
HainKurtSr. System AnalystCommented:
<iframe onLoad="someFunction()"...>

more info on this : http://www.dyn-web.com/tutorials/iframes/
0
 
TotallyMeAuthor Commented:
HainKurt: I believe that will only work on the same domain name it won't work if your trying to grab the HTML of another website due to security concerns.
0
 
TotallyMeAuthor Commented:
Oppps, replied to the wrong post above.... sorry.
0
 
TotallyMeAuthor Commented:
Found the best method :

$('iframe').load(function () {
 // do this
});
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now