How To Change Content Of Website Loaded In Iframe?
I need to change content of website using jQuery loaded in iframe from other domain such this:
Solution 3:
Your script is running during runtime so it will not find the DOM of the iframe and will break. What you can do is create a function on your parent page like:
//On Your Parent pagefunctionmodifyIframeContent() {
$('iframe').find('div#message').value('hello');
}
Then call this function from the iframe after it loads.
// On Your Iframe pagewindow.onload = function() {
parent.modifyIframeContent();
}
Of course: Your iframe must be of same domain for this work.
Post a Comment for "How To Change Content Of Website Loaded In Iframe?"