Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reload or Change Location in Frame, via Onload in Another

Status
Not open for further replies.

SetoKaiba

Programmer
Jun 16, 2004
28
US
Well I am coding a simple Chatting script, and I have run into a problem with getting the chat body (where it shows the msgs) to reload after a user submits a message to it. Anyway the structure of my page is the following:

Main Window, with my site navigation, etc.
chat --> Iframe in the main body of the page.
chat_gateway.php --> Contains the frames:
frameset
frameset
chat_body --> Contains the msgs,
chat_members
/frameset
chat_send --> Contains the submitting script
/frameset
Now, I decided to have the onload in the chat_send frame, so that when the body of it loads, it triggers the chat_body frame to reload, what code would I put in the onload="CODE" in the chat_send frame?
*Has tried searching Google extensively but none of the things work, thinks its due to the use of that IFrame*
 
Try something like:

Code:
<body onload="parent.frames['otherFrameName'].location = parent.frames['otherFrameName'].location.href;">

'hope that helps.

--Dave
 
No, it doesn't work... What would I do to call the history.go(0) on that frame?
 
I wrote 'otherFrameName' but it should probably be 'otherFrameId' In other words, the ID of the FRAME should be called, not the NAME.

If that doesn't make it work, consider changing:

parent.frames['otherFrameName'].location

...to:

parent.frames['otherFrameName'].document.location

...in both places it's used.

If those don't work, anything I could say about using history.go(0) is not likely to work either.

Can you post the HTML of the frameset so I can have something to play around with?

--Dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top