I have this iFrame in my parent window…
<iFrame src="http://theirdomain.com" id="Post_iFrame"></iFrame>
Then I have the jquery script…
$(document).ready(function(){
$(document).on("click","#transfer",function() {
var $currentIFrame = $('#Post_iFrame');
$currentIFrame.contents().find("body #Name1").val("My new value");
});
});
I am trying to find the text field #Name1 in the iframe and populate this input with My new value but nothing is happening. Any suggestions?
Following your comment:
You need to have a look at Same Origin Policy:
For you to be able to get data, it has to be:
Same protocol and host
You need to implement JSONP to workaround it.