Created
May 15, 2018 01:45
-
-
Save rolldone/1c6cb14e49345c70b8351cdad97112ef to your computer and use it in GitHub Desktop.
get iframe dom using jquery
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<iframe onload={()=>{ | |
setTimeout(()=>{ | |
// console.log(.html()); | |
},1000); | |
$.when($('#framenya').contents().find('html')).then((dom)=>{ | |
var waitForEl = function(selector, callback) { | |
if (dom.find(selector).length) { | |
setTimeout(function() { | |
callback(); | |
}, 1000); | |
} else { | |
setTimeout(function() { | |
console.log('waiting'); | |
waitForEl(selector, callback); | |
}, 1000); | |
} | |
}; | |
waitForEl(".the-key-is-loaded", () => { | |
console.log(dom.html()) | |
console.log('loadeddddddddddddd'); | |
}); | |
}) | |
}} id="framenya" src="http://artywiz.local/prerender/1160?logo_part=black-icon-title-slogan.png" frameborder="0" ></iframe> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment