I have the id of the parent, but not the child iframe.
Is there a way to return the iframe within the parent iframe?
Or, all iframes within a particular iframe?
Using jQuery to find element with $('iframe') doesn't seem to work.
If the iframe's src attribute has the same domain, protocol and port, you are set. If not, you can't do anything because of Same Origin Policy.
Assuming you are not violating the policy...
var iframe = document.getElementsByTagName('iframe')[0],
iframeDocument = iframe.contentWindow || iframe.contentDocument,
internalIframes = iframeDocument.getElementsByTagName('iframe');
You need to use the || short circuit evaluation exploit as IE is different.
var internalIframes = $('iframe:first').contents().find('iframe');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With