How can I call a javaScript function present in a child <iframe>
node from the parent? I am using jquery selector to select the correct iframe node but do not know how to call the function. Also the desired iframe has been added dynamically using jquery.
For example, the iframe is
<iframe id="frameOne" src="http://form_one.html"><iframe>
I need to do something like this
$(#frameOne).submitList();
where submitList()
is a fun开发者_如何学Goction in form_one.html.
Thanks.
document.getElementById('frameOne').contentWindow.submitList();
frameOne should be the ID of the frame!
As long as both of the URLs are in the same domain it should work.
If they are not, then you run into cross-domain issues
精彩评论