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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Embedded IFRAME needs to refresh its parent after event 2

Status
Not open for further replies.

AlaskanDad

Programmer
Mar 1, 2002
188
US
This is a sticky one.

- I've got a default.htm with an IFrame (inframe.asp) in it.
- Inside inframe.asp is chatroom.asp
- Inside chatroom.asp is three Frames
- The middle frame is sourced by chatwindow.asp
- Inside chatwindow.asp is an IFrame (RoomRefresher.asp)

RoomRefresher.asp continually checks to see if a new message has been added to the database. When it has, I want chatwindow.asp to be refreshed.

I've got RoomRefresher.asp to trigger positively but don't know how to correctly refresh its parent.

Any suggestions?
- Rob
 
Using Javascript:
Code:
parent.location.reload();

--Chessbot

There is a level of Hell reserved for probability theorists in which every monkey that types on a typewriter produces a Shakespearean sonnet.
 
Is there anyway to affect a querystring with that reload()?

Unfortunately, when a new message is added, the URL has a Msg=1 querystring sent to the chatwindow.asp page. When the page is reload()-ed, the Msg=1 querystring is repeated which adds a new message to the database, which causes a reload, which adds a new message.... etc.

Can anything be added inside of the ()'s ?

Thanks!
 
Hmm, try this:

Code:
parent.location = parent.location.split("?")[0];

*cLFlaVA
----------------------------
[tt]insert funny quotation here.[/tt]
 
I'm afraid I don't understand what that's supposed to do.

I do want the parent reloaded (there are some "good" querystrings in there) but I don't want Msg=1 included. Maybe we could specify Msg=0?

Thanks for your continuing help.
 
What about:

Code:
parent.location = parent.location.replace("Msg=1", "Msg=0");

*cLFlaVA
----------------------------
[tt]insert funny quotation here.[/tt]
 
Happy Dance Time!!!!

Thanks to cLFlaVA and chessbot for getting me to think out loud!

After the new message was added, I simply redirected the page to itself without the Msg=1 so it was set for the parent.location.reload().

Now, it works perfectly!

Thanks again!
-Rob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top