Why doesn’t
$(window['iframeName'].document.body).html()
…work when i change .attr('src')
When i set the src attribute of iframe to any url when i creating the page, this code
$(window['iframeName'].document.body).html()
…will work.
But when i change the src attribute by .attr('src',"www.google.com.sa") and wait to load the page,
$(window['iframeName'].document.body).html()
…will doesn’t work.
Where is the problem ?
When you load a page from a different domain in the iframe, you can’t access it. This is for security reasons.