I am using a hosted CMS that displays an iFrame in another iFrames. These iFrames are loaded from the same domain, but since this is a hosted CMS, I do not have direct access to these iFrames. Is it possible using jQuery to embed HTML content in an bodyiFrame tag with an identifier re_contentIframe?
This is how the code is displayed on my website:
<div class="editor">
<iframe id="editorf" frameborder="0" src="/ForumEditor.aspx?ForumID=2221&TopicID=-1&NoTemplate=False&Internal=False" style="display: inline;">
<html>
<head></head>
<body>
<iframe id="re_contentIframe" frameborder="0" src="javascript:'<html></html>';">
<html>
<head></head>
<body> </body>
</html>
</iframe>
</body>
</html>
</iframe>
</div>
I tried using the following code, but nothing happens with this code (including errors):
$(function() {
$( "#test" ).click(function() {
$("#re_contentIframe").contents().find("body").html("<p>new HTML content goes here</p>");
});
});
source
share