How to update child iFrame's entire html (header+body) inside jQuery's post
- by knappy
I have a chat webpage for Firefox that is structured like this
..... Outer HTML
-----|......Frameset Frame
------------|...... header: contains jQuery post has returned data: rdata = new_iFrame_html_str, the entire html string of the iFrame that should be updated
------------|...... iFrame
--------------------|...... header: contains jQuery
--------------------|...... body: chat messages that depends on the header jQuery to behave properly
QUESTION: I can't this jQuery post to work, i.e. I can't find a way for this post to update the ENTIRE iFrame (header + body).
Things I've tried and FAILED with javascript and jQuery:
top.frames['framesetFrame_name'].document.getElementById('iframe_id').contentDocument.body.innerHTML = new_iFrame_html_str;
I don't like this because it's only changing the body, not the header, so the behavior generated from jQuery can't be shown
top.frames['framesetFrame_name'].document.getElementById('iframe_bucinid').contentWindow.location.reload();
I do not want to reload because a reload makes the iFrame flicker, bad for a chat program
top.frames['framesetFrame_name'].document.getElementById('iframe_id').contents().html = new_iFrame_html_str;
Not updating anything that shows :(
top.frames['framesetFrame_name'].document.getElementById('iframe_id').contentWindow.location.href = new_iFrame_html_str;
This is actually the wrong form here, because it should be = url_of_new_content
$( top.frames['framesetFrame_name'].document.getElementById('iframe_id') ).html( new_iFrame_html_str ) ;
Not updating anything that shows :(