Iframe Load Event

Iframe has an "onLoad" event. Caveat while using Iframe: It's mandatory for the iframe to load some valid content in order to fire off the onload event. It might be desirable for a few use cases to wait for that to happen. Hi, I'm trying to bind to iframe load event, using $("iframe"). hello sir , i am using iframe from a 3rd party. You can use an IFRAME to display the contents from another website in a form, for example, in an ASP. The code tries to load a website URL in an and checks for both events:. It might be me but I dont seem to get a Page_Load event when a opening an ASPX in an iFrame. Custom load event. Changing Iframe Src How to change iframe src to a new URL, with or without JavaScript. To get latest src URL, we have to use Iframe. Perviously, when I had an IFRAME tag on a page and I wanted to get access to the document object within that IFRAME, I would use the top window's "frames" collection: window. Here's how I used postMessage to get the height and width of a document in an iFrame. The JavaScript onload event can be applied when it is necessary to launch a specific function once the page is displayed fully. First we show how the document in the iframe can get references to the iframe element containing it and to the containing document and its properties and objects. DOM Events are sent to notify code of interesting things that have taken place. Dynamically Generating an Iframe How to create and insert an iframe using DOM methods. Onload() event cannot. The content which is loaded to the IFrame is a complex html page, which includes lot of JavaScript. elements have a load event for that. Hi, I'm trying to bind to iframe load event, using $("iframe"). I have a web application that uses the onreadystatechange event to detect when a page inside an iframe has finished loading. How can I fix this? I use your code but it didn't work for me. When a frame has been loaded, opera dispatches an event on the owner iframe. It is the ultimate modularization tool, allowing you to break up content, seamlessly display content from other sources, and better manage loading. In the handler, we grab the source attribute of the event, which is the parent window. onload (on the embedded window object). The OnReadyStateComplete event triggers when content of the IFRAME has loaded fully. What I do here is on document load I check if the browser url contains any hash argument, if it does I take the value and append it to the legacyApp url. But , my problem is, I need to load the page in iframe, when button is clicked in someother page loaded in another iframe. If you just want to create a DHTML page that loads content dynamically, you may want to use the appropriate HTML sectioning elements, and. Custom load event. waiting = false; This is a little different to how your function returns a value, but I'm guessing there's a different way you could code that to do what you want. Ask Question Asked 18 days ago. Lazy-load your iFrames. This event can be used while referencing IFRAME controls within scripts. src)"); You'll see that Firefox is only showing one alert, and it's showing the alert on the load event AFTER changing. In IE11 the event just does not fire. contents() method allows us to search through the immediate children of these elements in the DOM tree and construct a new jQuery object from the matching elements. I am looking for a way to access a button inside the iFrame and trigger a click event when that button is clicked inside the iFrame that is on another domain. You can use an IFRAME to display the contents from another website in a form, for example, in an ASP. While not exactly the solution to why the iframe load isn't triggering more than once, it's a much better workaround than creating a new iframe each time! Thanks! -----. iframe and load/unload events. I could not get the click event fired. load(callback) event is not fired on dynamically loaded content - jQuery Forum. Note that although the DOM always becomes ready before the page is fully loaded, it is usually not safe to attach a load event listener in code executed during a. (2kb) When you run the project you will notice when the iframe loads there is. We have removed the experimental status from the IFrame Player API. _content makes no sense for a remote app (it's the same as window. onload event as well? eg referring to the AddLoadEvent function for multiple load events by Simon Wilson. Events in parent window (html document) will be invisible to child window opened in IFrame. For example, modify your test case to change this line: iframe. The event is easier for me to write bug free code in most cases because someone else is responsible for calling other callbacks. refresh() or whatever in response to the iframe's load event, the iframe's URL gets reset to whatever it originally does because the parent document refreshes. This documentation change does not reflect a. on( "load" ) in action. Once PDF is loaded it triggers onloat event where i'm hiding the loader 🙂 The important part: iFrame has "onLoad" event where you can do what you need (hide loaders etc. Whenever the parent executes postMessage on the iframe's contents, this event will trigger, giving us access to the string our parent would like us to execute. This event then bubbles up to the window. If I do get the even triggered. x IFRAME and web resource controls embed content from another location in pages by using an HTML IFRAME element. document I did this because I could never figure out how to get at the document object directly from the. iframe onload event not firing in safari and chrome The onload event does not fire when page is loaded. Actual Results:. Let's see how we can solve this problem. how can I do that? to be more specific, there is a datagrid in parent page and after I edit data in a dialog modal iframe, I want to update the row in datagrid. How to insert HTML content into an iFrame using jQuery. It triggers when the embedded window fully loads with all resources. I do geta Page_Load event when an item on the ASPX (inside the iFrame) is clicked but then IsPostBack=False by now!. The DOM emits the load event on iFrame only when all the static assets have been downloaded and all the elements in the DOM tree have fired their load event. This is an interesting problem since the IFrame only seems to be chocking on the PDF documents. Once the iframe content completes the loads, the hideLoader() function is executed via the onload event on the iframe element. Or else, the on load event won't fire off. This content is a separate document. Responsive iframes with CSS only, no hacks or JS, just clean, cross-browser compliant code — it's possible. Electron version: 1. With jQuery resize event, you can now bind resize event handlers to elements other than window, for super-awesome-resizing-greatness!. How to assign click event to. I kind of understand the concept, but I am slightly confused. This works great to trigger an event if the iFrame wrapper is clicked, but trying to go deeper into an element within the iFrame has proven difficult. Iframe has an "onLoad" event. It bubbles to the window. Adding an "onload" event handler to an iframe DOM object in IE I have a handle to an iframe dom object. How you listen to that event is up to you, but generally the best way is to: 1) create your iframe programatically It makes sure your. In the course of experimenting with click tracking and heatmaps I needed to. Javascript now allows cross-document communication thanks to the postMessage function. The iframe load event steps mutate state and fire an event. Answer: Use the jQuery contents() method. So, the code running in the IFrame context, cannot trigger the event of the controls of the parent window (web page). I'm trying to load page before load the map ( I use is map extreme ) although I use document ready function, the page trying to load mapLabels with page objects. Questions: Is there a way to capture when the contents of an iframe have fully loaded from the parent page? Answers: elements have a load event for that. Ensure the URL being loaded into the iframe is allowed to be loaded, "check out the output in Chrome Development tools for loading erros". Here are examples of a frame with no styles and one with just the basics styled. For full details on this event please see the page on the Document: DOMContentLoaded event. load (function(){ }. It's done with an HTML iframe tag. Currently, XUL iframes running in remote processes are not supported. iframe onload event not firing in safari and chrome The onload event does not fire when page is loaded. Anyone knows how I can make my app listen for an event on an iframe, indicating it is fully loaded? I have two kinds of iframes in my Sencha Touch 2 app: Embedded Vimeo movies (youtube doesn't work well with html5) Google Maps Both iframe embeds work fine, interaction on the iframes works also. Text 'HTML IFrame loaded' and 'Embed IFrame loaded' should appear; Note: This works as expected in Edge and Chrome, but not IE11 (a yellow bar appears at the bottom in IE asking the user to save or open the PDF) Expected Results: load event should be fired for any content on completed loading. The code below I am having problems with. I have this structure: Index. Onload() event cannot. It bubbles to the window. In the course of experimenting with click tracking and heatmaps I needed to. The first load event gets fired after the iframe has been injected into the DOM, and is used to prepare the actual submission. The document in the iframe comes from a different domain which I can not alter the contents. When I load the html page to the iframe by using the src attribute it works fine. iframe load event + downloaded file If this is your first visit, you may have to register before you can post. Responsive iframes with CSS only, no hacks or JS, just clean, cross-browser compliant code — it's possible. Subload must not start prior to this load event is dispatched. This event can be used while referencing IFRAME controls within scripts. 3) You may also attach the event listener after the element, inside a tag, but keep in mind that in this case, there is a slight chance that the iframe is already loaded by the time you get to adding your listener. HTML Tag Reference HTML Event Reference HTML Color Reference invalid keydown keypress keyup load loadeddata loadedmetadata loadstart an iframe should look. Altering iFRAME CSS via OnLoad event I'm aware that each form can have an onLoad event and what I'm doing is loading another CRM window into the iFrame (this part is working very well). I'm trying to load page before load the map ( I use is map extreme ) although I use document ready function, the page trying to load mapLabels with page objects. The example below shows $( document ). ready() Specify a function to execute when the DOM is fully loaded. The iframe load event steps mutate state and fire an event. The load and unload events fire when an asset loads, or the entire page unloads. I had a task on the project that I'm working on. What I do here is on document load I check if the browser url contains any hash argument, if it does I take the value and append it to the legacyApp url. How can I make this work in safari and chrome. iframe onLoad event in IE the dom inspector shows a load event being fired, in the browser. To start viewing messages, select the forum that you want to visit from the selection below. and vice-versa. JavaScript / Ajax / DHTML Forums on Bytes. But , my problem is, I need to load the page in iframe, when button is clicked in someother page loaded in another iframe. load (function(){ }. /mach test-tidy does not report any errors These changes fix #18564 These changes do not require tests because the existing tests do the job This change is. After searching the web this seemed the best solution to me, it doesn't require that you have control of the loaded pages like the top voted answer on stack. load(callback) event is not fired on dynamically loaded content - jQuery Forum. dojo/request/iframe can by proxying those calls through an IFrame, making it possible to still do file uploads in an asynchronous manner. How to assign click event to. Dynamically Generating an Iframe How to create and insert an iframe using DOM methods. iframe onload event only after an anchor onclick. Okay so the injectJS() function looks like this. How can I detect whether an iframe is loaded? ('load the iframe') //the console won't show anything even if the iframe is loaded. Once the iframe content completes the loads, the hideLoader() function is executed via the onload event on the iframe element. The iFrame component lets you load external URL elements (including other web pages) in your project within an iframe. now the purpose of this , is to load the iframe after the page load event of the asp. dojo/request/iframe can by proxying those calls through an IFrame, making it possible to still do file uploads in an asynchronous manner. I kind of understand the concept, but I am slightly confused. OnReadyStateComplete Event. Once PDF is loaded it triggers onloat event where i'm hiding the loader 🙂 The important part: iFrame has "onLoad" event where you can do what you need (hide loaders etc. HTML5 recommends that you use the. I have this structure: Index. The OnReadyStateComplete event triggers when content of the IFRAME has loaded fully. A main page's window. We'll use this to send the result of our hard work back up once we're done. IFrame onLoad event handler is called in Firefox but not in Chrome. Yup, you're right. Auto-resize Iframe when Content Size Changes. href" to set the page loaded in the iframe to a given url, and both methods work perfectly in both ff3 and ie7. Can some one please tell me how I can listen for the click event of a button that is inside of an Iframe? I need to take some action in the parent form based when the button in the Iframe is clicke. HTML Tag Reference HTML Event Reference HTML Color Reference invalid keydown keypress keyup load loadeddata loadedmetadata loadstart an iframe should look. Note: Prior to jQuery 3. I have a page with multiple views. The JavaScript. Lazy-loading yields priority to other resources that your user may need first. contentWindow. here's my javascript to resize iframe and need some edit. It might be me but I dont seem to get a Page_Load event when a opening an ASPX in an iFrame. So, the code running in the IFrame context, cannot trigger the event of the controls of the parent window (web page). Maybe this should just be changed to "queue a task to run the iframe load event steps"?. Perviously, when I had an IFRAME tag on a page and I wanted to get access to the document object within that IFRAME, I would use the top window's "frames" collection: window. Okay so the injectJS() function looks like this. As if it's not allowed to be loaded the onload event will never be called. For example, some versions of Firefox trigger the event when a link is followed, but not when the window is closed. Text 'HTML IFrame loaded' and 'Embed IFrame loaded' should appear; Note: This works as expected in Edge and Chrome, but not IE11 (a yellow bar appears at the bottom in IE asking the user to save or open the PDF) Expected Results: load event should be fired for any content on completed loading. I load an aspx page in iframe inside a jQuery UI dialog to update some data, and after dialog is closed I need to update an updatepanel in parent page. To javascript, iFrames are typically black boxes. I have an onLoad event on the iframe which triggers my script when the page loads but I need to fire the script. It triggers after the script was loaded and executed. Responsive iframes with CSS only, no hacks or JS, just clean, cross-browser compliant code — it's possible. Note that the load and unload events should also fire when you use the Back and Foward buttons to navigate. The jQuery UI dialog is easy to get started with but has a few areas that causes new users some trouble. IFRAMES and web resources load asynchronously and the frame may not have finished loading before the Onload event script finishes. Auto-resize Iframe when Content Size Changes. Note that although the DOM always becomes ready before the page is fully loaded, it is usually not safe to attach a load event listener in code executed during a. Hello friend, Thank U very much. setAttribute("onload", "alert('load event for dynamic iframe fired: ' + this. You can use the jQuery contents() method in combination with the find(), val() and html() method to insert text or HTML inside an iframe body. How can I fix this? I use your code but it didn't work for me. Events in parent window (html document) will be invisible to child window opened in IFrame. onload event (on the tag) is essentially the same as iframe. Topic: JavaScript / jQuery Prev|Next. Now my problem here is that when the iframe loads , it does not pass the parameters to the url that is being set in the iframe. According to Srigi, to ensure that the iframe content is loaded as well and ready to process the incoming messages, the postMessage can be wrapped into onload event. ready() in a page but Body. Text 'HTML IFrame loaded' and 'Embed IFrame loaded' should appear; Note: This works as expected in Edge and Chrome, but not IE11 (a yellow bar appears at the bottom in IE asking the user to save or open the PDF) Expected Results: load event should be fired for any content on completed loading. set to the size that fits in my document. Iframe load event in firefox extension. When a Document in an iframe is marked as completely loaded, the user agent must run the iframe load event steps in parallel. Ensure the URL being loaded into the iframe is allowed to be loaded, "check out the output in Chrome Development tools for loading erros". This actually fires off on the original 'onload' event when you first create the iframe, so to make it useful you need a counter so you can ignore the first one. iframe onload event not firing in safari and chrome The onload event does not fire when page is loaded. Tried lot of tricks to achieve but did not work for me. /mach build -d does not report any errors. Problem is that the browsers expect Chrome don't show the processing/loading sign when the IFrame is loading in background. readyState property. so how to do that. The example below shows $( document ). Now my problem here is that when the iframe loads , it does not pass the parameters to the url that is being set in the iframe. frames[ "my-frame" ]. Dynamically Generating an Iframe How to create and insert an iframe using DOM methods. I also hookup the iframe load event to update the hash when a new iframe page has loaded, for example after a you click a link to go to another page in the iframe. Google Calendar (in iframe) can't be loaded properly. document I did this because I could never figure out how to get at the document object directly from the. Iframe load event not firing (anon. According to Srigi, to ensure that the iframe content is loaded as well and ready to process the incoming messages, the postMessage can be wrapped into onload event. To start viewing messages, select the forum that you want to visit from the selection below. How can I fix this? I use your code but it didn't work for me. It might be me but I dont seem to get a Page_Load event when a opening an ASPX in an iFrame. onload (on the embedded window object). Responsive iframes with CSS only, no hacks or JS, just clean, cross-browser compliant code — it's possible. To start viewing messages, select the forum that you want to visit from the selection below. crmalibu Unfortunatley the later script is returning the title of the index page every time 'display' window is loaded and I want the title of the document in 'display'. The code tries to load a website URL in an and checks for both events:. Subload must not start prior to this load event is dispatched. The JavaScript onload event can be applied when it is necessary to launch a specific function once the page is displayed fully. You can detect any time an iframe changes location by placing a function on the 'onload' event listener of that iframe. The onload event can deal with cookies. Once PDF is loaded it triggers onloat event where i'm hiding the loader 🙂 The important part: iFrame has "onLoad" event where you can do what you need (hide loaders etc. The document in the iframe comes from a different domain which I can not alter the contents. While not exactly the solution to why the iframe load isn't triggering more than once, it's a much better workaround than creating a new iframe each time! Thanks! -----. onload Event Explained. And I want to blog the simple solution that I made for this task. In the example below, all we are doing is immediately displaying the animited GIF in the middle of the iframe element. I do geta Page_Load event when an item on the ASPX (inside the iFrame) is clicked but then IsPostBack=False by now!. Questions: Is there a way to capture when the contents of an iframe have fully loaded from the parent page? Answers: elements have a load event for that. load (function(){ }. On this page, a document in an iframe uses JavaScript to interact with its parent document. iframe onload event. Maybe this should just be changed to "queue a task to run the iframe load event steps"?. Javascript now allows cross-document communication thanks to the postMessage function. Most of us who develop Web Applications would have used an IFRAME during some stage of our lives. contentWindow. here's my javascript to resize iframe and need some edit. Now lets go on an implement our function injectJS() this is the function that will be called when IFrame src is fully loaded. In this case, you have to add load event listeners to all your frames so. It postpones loading of all other iFrames until they are about to come into browser's viewport. Or else, the on load event won't fire off. These content pages can't directly add a function to the body's onload event. 'preview-pane' is the ID of my iframe and I'm using YUI to attach the event handler. Polling IFrame for Completion: Our solution is based on the IFrame. Tried lot of tricks to achieve but did not work for me. Jest+Enzyme+React iframe loaded event not firing. Bind an event handler to the "load" JavaScript event. The iframe element has an onload event, and although the iframe onload attribute is not valid in HTML4, it is valid in HTML5. I am looking for a way to access a button inside the iFrame and trigger a click event when that button is clicked inside the iFrame that is on another domain. load event is not raised in the Edge browser if the page contains an iframe element with a colon symbol in its src attribute value. Here are examples of a frame with no styles and one with just the basics styled. Iframe Onload Event How to trigger action once an. The load event fires at the end of the document loading process. For example, one iframe could be a contents page and the pages in the contents load into the second iframe. Once I'm sure that customer can see my loader, i'm calling onCompllet loaders method that loads an iframe. So i just want to show a "Please wait or Loading" kind of message before the Iframe is being loaded. Shared components used by Firefox and other Mozilla software, including handling of Web content; Gecko, HTML, CSS, layout, DOM, scripts, images, networking, etc. The src attribute can be used to specify the content of the frame. document I did this because I could never figure out how to get at the document object directly from the. There can be possible incompatibilities with 'raw JS' approach (if we define SRC attribute at the bottom of the page). Hi, I'm trying to bind to iframe load event, using $("iframe"). but i want to do that automaticaly after the iframe i loaded. HTML Iframes (HTML Inline Frames) - Learn HTML to develop your website in simple and easy steps starting from basic to advanced concepts with examples including overview, basic tags, meta tags, attributes, formatting, phrase tags, comments, fonts, marquees, images, links, tables, frames, lists, layouts, colors, forms, backgrounds, style sheet, javascript. Caveat while using Iframe: It's mandatory for the iframe to load some valid content in order to fire off the onload event. target of that element is the iframe whose content has loaded. dojo/request/iframe works similar to other providers, but it has some specific caveats because of the nature of the iframe mechanism. While not exactly the solution to why the iframe load isn't triggering more than once, it's a much better workaround than creating a new iframe each time! Thanks! -----. Let's see how we can solve this problem. When a Document in an iframe is marked as completely loaded, the user agent must run the iframe load event steps in parallel. The document in the iframe comes from a different domain which I can not alter the contents. I was recently rolling my own AJAX upload script, posting a form to a hidden IFRAME and using the load event to know when the upload was complete. DOM Events are sent to notify code of interesting things that have taken place. Viewed 15 times. Hi all, The following GM script to resize the google notebook gadget was working earlier today, I swear :) There are no visible warnings or errors. The event is easier for me to write bug free code in most cases because someone else is responsible for calling other callbacks. Anyone knows how I can make my app listen for an event on an iframe, indicating it is fully loaded? I have two kinds of iframes in my Sencha Touch 2 app: Embedded Vimeo movies (youtube doesn't work well with html5) Google Maps Both iframe embeds work fine, interaction on the iframes works also. This event then bubbles up to the window. HTML5 recommends that you use the. iframe onload event only after an anchor onclick. You can use the jQuery contents() method in combination with the find(), val() and html() method to insert text or HTML inside an iframe body. Load: In this event the Page object calls the OnLoad method on the Page object itself, later the OnLoad method of the controls is called. However, trying to access the body in my callback (upon iframe load) fails, I think because the iframe loads before the event handler is ready. Once PDF is loaded it triggers onloat event where i'm hiding the loader 🙂 The important part: iFrame has "onLoad" event where you can do what you need (hide loaders etc. ready() and $( window ). /mach build -d does not report any errors. Scroll to the bottom of the Form Properties window and Click on Add under Event Handlers. I am able to use ". I also hookup the iframe load event to update the hash when a new iframe page has loaded, for example after a you click a link to go to another page in the iframe. How can I make this work in safari and chrome. It is used to load the page dynamically in iframe from current page containing iframe. But, it was undesirable for our use case. If you just want to create a DHTML page that loads content dynamically, you may want to use the appropriate HTML sectioning elements, and. How to check if iframe fails to load? jquery? What it does it when a user clicks the submit button, it would hide the form, show the loader, then submit the data to a link and load the output in an iframe. I am using Firefox v41 and Chrome v46 and react v0. A collection of properties that represent the presence of different browser features or bugs. For full details on this event please see the page on the Document: DOMContentLoaded event. Iframe has an "onLoad" event. setAttribute("onload", "alert('load event for dynamic iframe fired)"); to this: iframe. Hi, i've an iframe An when a specific event is fired a POST request is sent to a servlet. I have a page with an iframe. href" to set the page loaded in the iframe to a given url, and both methods work perfectly in both ff3 and ie7. Each event is represented by an object which is based on the Event interface, and may have additional custom fields and/or functions used to get additional information about what happened. These content pages can't directly add a function to the body's onload event. The jQuery UI dialog is easy to get started with but has a few areas that causes new users some trouble. Any help over how to bind a click event of iFrame element using jQuery would be much appreciated. This content is a separate document. And finally, add an onLoad event to your iframe: onload="hideProgress()" So what it does, the loading text will be displayed first, then as soon as the iframe finished loading, the onLoad event is executed and hideProgess() function being called, which would hide the loader text. The main helper is the load event. So the most safe way is to envelope the whole iframe into div, and replace contents of this div at the bottom of the page (with actual iframe). If I do get the even triggered. What I do here is on document load I check if the browser url contains any hash argument, if it does I take the value and append it to the legacyApp url. iframe onload event. What I'd like to do is to alter the CSS of the loaded page (the one in the iFrame) as it has some padding surrounding it that I'd like to remove. To add the iFrame component to your project: Open the Components panel, then. 'iframe' Event Handlers : iframe « HTML Tag Reference « HTML CSS Reference. HTML5 recommends that you use the. There can be possible incompatibilities with 'raw JS' approach (if we define SRC attribute at the bottom of the page). In this case, you have to add load event listeners to all your frames so. Here is an example;. The OnReadyStateComplete event triggers when content of the IFRAME has loaded fully. NET Forums on Bytes. onload (on the embedded window object). It is the ultimate modularization tool, allowing you to break up content, seamlessly display content from other sources, and better manage loading. According to Srigi, to ensure that the iframe content is loaded as well and ready to process the incoming messages, the postMessage can be wrapped into onload event. On this page, a document in an iframe uses JavaScript to interact with its parent document. I would assume that Load event should be at least triggered when the viewer is loaded (not necessarily the pdf file within the viewer) If you load html content then both BeforeLoad and Load events are triggered. After the map finished it's job the css loaded. > > You confused me because window. Or else, the on load event won't fire off. First we show how the document in the iframe can get references to the iframe element containing it and to the containing document and its properties and objects. A collection of properties that represent the presence of different browser features or bugs. I'm trying to load page before load the map ( I use is map extreme ) although I use document ready function, the page trying to load mapLabels with page objects. However, it would not be possible for the containing document to make a reference to the document inside the iframe due to the restrictions of the Same Origin Policy. The JavaScript onload event can be applied when it is necessary to launch a specific function once the page is displayed fully. We'll use this to send the result of our hard work back up once we're done. With jQuery resize event, you can now bind resize event handlers to elements other than window, for super-awesome-resizing-greatness!. JQuery - Example of Tabs Event Handling. At this point, all of the objects in the document are in the DOM, and all the images, scripts, links and sub-frames have finished loading. Or else, the on load event won't fire off. The load event fires at the end of the document loading process. I am able to use ". A different event, load, should be used only. Hi all, The following GM script to resize the google notebook gadget was working earlier today, I swear :) There are no visible warnings or errors. But, it was undesirable for our use case. It's done with an HTML iframe tag. OnReadyStateComplete Event. The code tries to load a website URL in an and checks for both events:. We'll use this to send the result of our hard work back up once we're done. Track the response status of a IFrame. Scroll to the bottom of the Form Properties window and Click on Add under Event Handlers. but i want to do that automaticaly after the iframe i loaded. This event can be used while referencing IFRAME controls within scripts. on( "load" ) in action. I would assume that Load event should be at least triggered when the viewer is loaded (not necessarily the pdf file within the viewer) If you load html content then both BeforeLoad and Load events are triggered. Iframe onload event only after an anchor onclick after clicking on the link and when the iframe finishes. Avoid using the OnLoad Event.