Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

jquery check if iframe is loaded

$('#myIframe').on('load', function(){
    //your code (will be called once iframe is done loading)
});
Comment

jquery when iframe is loaded

<script>
function checkIframeLoaded() {
    // Get a handle to the iframe element
    var iframe = document.getElementById('i_frame');
    var iframeDoc = iframe.contentDocument || iframe.contentWindow.document;

    // Check if loading is complete
    if (  iframeDoc.readyState  == 'complete' ) {
        //iframe.contentWindow.alert("Hello");
        iframe.contentWindow.onload = function(){
            alert("I am loaded");
        };
        // The loading is complete, call the function we want executed once the iframe is loaded
        afterLoading();
        return;
    } 

    // If we are here, it is not loaded. Set things up so we check   the status again in 100 milliseconds
    window.setTimeout(checkIframeLoaded, 100);
}

function afterLoading(){
    alert("I am here");
}
</script>

<body onload="checkIframeLoaded();"> 
Comment

PREVIOUS NEXT
Code Example
Javascript :: js read text file line by line 
Javascript :: regex optional whitespace characters 
Javascript :: creating a 2d array in js 
Javascript :: react-fragment 
Javascript :: how to iterate over list in jquery 
Javascript :: express get query parameters 
Javascript :: get an array with unique values 
Javascript :: how to run js before submit html 
Javascript :: loop elements in javascript 
Javascript :: jquery remove class 
Javascript :: angular 2 reactive forms radio button by default checked 
Javascript :: js copy to clipboard 
Javascript :: get last word in string js 
Javascript :: display content in a modal react 
Javascript :: how to remove whitespace only from first position of string js 
Javascript :: include other js files in a js file 
Javascript :: how to use svg in react js 
Javascript :: PayloadTooLargeError 
Javascript :: react password hashing 
Javascript :: copy to clipboard 
Javascript :: javascript join list of string 
Javascript :: npx create-express-api 
Javascript :: refresh page by hand in react 
Javascript :: jsx classname multiple 
Javascript :: ruby write json to file 
Javascript :: get current time jquery 
Javascript :: jquery make visible 
Javascript :: csv to json python 
Javascript :: if cart empty shopify 
Javascript :: How to replace a value in localstorage using javascript 
ADD CONTENT
Topic
Content
Source link
Name
4+6 =