Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I fire an event when a iframe has finished loading in jQuery?

I have to load a PDF within a page.

Ideally I would like to have a loading animated gif which is replaced once the PDF has loaded.

like image 242
Alex Andronov Avatar asked Aug 27 '08 12:08

Alex Andronov


People also ask

How do you call a function after an iframe is loaded?

To call a JavaScript function when iframe finished loading, we can add an event listener for the load event. to add an iframe. to select the iframe with querySelector . Then we set the iframe.


1 Answers

Have you tried:

$("#iFrameId").on("load", function () {     // do something once the iframe is loaded }); 
like image 186
travis Avatar answered Sep 28 '22 09:09

travis