I want to add a JavaScript snippet into an existing iFrame in the page using jQuery. I have the following code...
Code:
content = \"
This worked for me, paste following code in the page which is in an iframe, not the parent page:
window.myFunction = function(args) {
alert("script from iframe");
}
And now add following code to call above function:
var iframe = document.getElementById("iframeId");
iframe.contentWindow.myFunction(args);