How to retrieve html code from an iframe ?
I try:
$('#iframe').innerHtml
$('#iframe').contents()
Its not works.
Have you a idea ?
Thanks
How to retrieve html code from an iframe ?
I try:
$('#iframe').innerHtml
$('#iframe').contents()
Its not works.
Have you a idea ?
Thanks
Due to Cross-Origin Resource Sharing (CORS) you can only access the content if the iframe is on the same domain.
The following javascript will work if it's the same domain:
document.getElementById('iframe').contentWindow.document.body.innerHTML