Click to See Complete Forum and Search --> : IFrame Change the parent


Pselus
03-10-2003, 03:25 PM
hey I'm a n00b at Javascript so I could use some help.
I have menus done in Javascript and dhtml. Each menu item changes an IFrame src on the page. I need some way to catch the postback (I'm working in ASP.NET) of the page inside the iframe (which I already know how). What I'm here about is how do I cause the parent of the IFrame (the page with the menus) to reload if the iframes refreshes.
i.e. I'm going to add an onLoad myScript(); to the iframe and in the myScript() I need to check what posted the page back and then refresh the parent of the IFrame.

khalidali63
03-10-2003, 03:32 PM
Here is one way of doing this.
Presuming that you have a way of knowing that when your IRAME was refreshed,then at that point you should be able to do something like this
top.window.location = top.window.location;

Hope this helps

Cheers

Khalid

Pselus
03-10-2003, 03:48 PM
quick question.
what's the best way for me to detect a postback to the page in the javascript? My past is with asp.net and asp 3.0 so I don't know how js would do this.

like in that myScript function someone test if it's on a postback and if it's on a specific one and if so to refresh the main page.

Pselus
03-10-2003, 04:09 PM
a question related to this.
how to I capture the source of the iframe from inside the iframe?
do I reference the parent somehow?
or just the page?

Pselus
03-10-2003, 04:16 PM
yeah I'm dumb I got it (this.location)....you'll learn that I ask questions then solve them immediatly afterward (only because I asked)
:rolleyes:

next question (which I'll probably solve)
how can I reference a function in a parent page?

khalidali63
03-10-2003, 04:20 PM
Lets just waite and see if you can solve it...lol

joking.

top.functionName() shoudl let you do this.

Khalid

Pselus
03-10-2003, 04:36 PM
yeah I'm too stupid to try that
:)
thx...I may be back