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();">
Also in JavaScript:
- ajax call
- js array map skip element
- jquery show flex
- label tag alternative in react native
- age validation jquery
- jquery validator Url
- jquery number format comma
- .filter js
- promise all in promise all
- Regular Expressions: Extract Matches
- Delete Properties from a JavaScript Object
- get form data as object jquery
- react router dom
- javascript pluck from array of objects
- javascript modify href attr
- useful javascript code snippet for console
- javascript format currency
- instanceof negation
- how to use if else inside jsx in react
- js remove from array by value
- cascading dropdown for forms react
- apache log format json
- javascript remove last charter stings
- defining props in react