While debugging jquery code on their site ( via chrome developer toolbar)
I noticed that their examples are given under Iframe
:
Here - for example there is a sample which is under an Iframe but after investigating , I see that the Iframe doesn't have SRC
The picture shows it all
Question :
Is it possible to set content to an Iframe without setting its SRC ?
p.s. this menu also shows me an empty content
In order to embed the intended document within the <iframe>, the address of the target document should be specified as src attribute value.
Iframes Bring Security Risks. If you create an iframe, your site becomes vulnerable to cross-site attacks. You may get a submittable malicious web form, phishing your users' personal data. A malicious user can run a plug-in.
IFrames are not obsolete, but the reasons for using them are rare. Using IFrames to serve your own content creates a "wall" around accessing the content in that area. For crawlers like Google, It's not immediately clear that cotent in an iframe will be ranked as highly as if the content were simply part of the page.
An iframe does not have an audio API, so you can't mute anything using JS on that element.
Yes, it is possible to load an empty <iframe>
(with no src
specified) and later apply content to it using script.
See: http://api.jquery.com/jquery-wp-content/themes/jquery/js/main.js (line 54 and below).
Or simply try:
<iframe></iframe> <script> document.querySelector('iframe') .contentDocument.write("<h1>Injected from parent frame</h1>") </script>
Yes, Here is how you change the html of the iframe with jQuery
var context = $('iframe')[0].contentWindow.document, $body = $('body', context); $body.html('Cool');
Demo: http://jsfiddle.net/yBmBa/
document.contentWindow: https://developer.mozilla.org/en-US/d...
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