Replacing entire page with ajax response from a frame

Larry Martell <[email protected]>
Newsgroups gmane.comp.web.dom.general
Message-ID <CACwCsY6PxBjQLS0=8URZwC-gfY5PMhEaS4VtmczP0YmkuUsLQg@mail.gmail.com>
I hope this is the correct forum for my question. If not I apologize
and I ask that someone direct me to a more appropriate forum. (I have
posted to the PHP list and to SO, but have not gotten a working
solution from either.)

I have a web page like this:


<html>
   <head>
      <title>Main </title>
   </head>
   <frameset frameborder=1 border=1 rows="140,*">
      <frame src="mainheader.php>
      <frameset frameborder=1 border=1 cols='75%,25%'>
         <frame src="main.php" name="main">
         <frame src="selection.php" name="selection">
      </frameset>
   </frameset>
</html>

>From the selection frame I send an ajax request. The response contains
a complete new page and I want to replace the existing page with the
response.

If I do:

document.open();
document.write(response);
document.close();

or:

var newDoc = document.open("text/html", "replace");
newDoc.write(response);
newDoc.close();

The new content is rendered within the frame the request originated from.

I then tried:

top.document.body.innerHTML = response;

and

parent.document.body.innerHTML = response;

In both case the entire doc was replaced, but only the top frame was
rendered. If I look at the page source everything is there, and if I
just hit return in the address bar all the frames are rendered. What
would prevent it from rendering all the frames when I do the
assignment?

Thanks!
-larry
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.