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

Refresh A Frame. 1

Status
Not open for further replies.

ddfff

MIS
Sep 27, 2002
125
US
I have the following html code.

<a href=&quot;mypage.cfm?supplycategory=#id#&quot; target=&quot;requestform&quot;>category</a>

This reloads the specified page in the specified iframe without reloading the parent page. It does exacly as I want it to do.

However, in addition to functioning as it does, I would also like this action to ALSO reload another frame. Basically, on click, both frame #1 (requestform) and frame #2 would reload in the parent page.

Suggesions are more than welcome and thank you in advance.

If nothing else, maybe I can use the javascript &quot;onclick&quot; equivalent of the above tag? Don't know.
 
try

<a href=&quot;mypage.cfm?supplycategory=#id#&quot; target=&quot;requestform&quot; onclick=&quot;parent.top.otherFrameName.location.reload();&quot;>category</a>

=========================================================
-jeff
try { succeed(); } catch(E) { tryAgain(); }
 
I think that is almost what I need. How would I alter the code slightly to reference the page name instead of just reload?

Thanks again.
 
you'd have to parse location.href or location.pathname

i'm not sure what difference it's going to make though between doing this and just calling reload()

=========================================================
-jeff
try { succeed(); } catch(E) { tryAgain(); }
 
jemminger thanks for your reply it saved me lots of time.....star for you!

Nick
 
Is there a way of refresing the frame but without reposting the data?

I have a page with two frames. main frame with a form, menu frame with some menu buttons, one of which is the interface language.

this is what I want:
1. submit the form in the main frame.
2. change the language in the menu frame - reload the main frame but without reposting the data.

I can't find a solution to that. I need the globals that pass in the url line, but I don't want the posted data to be posted again...

any help?
 
if the main frame was actually POSTed to, and you want to reload it (GET) while preserving querystring params, try "changing" its location to its current location:
Code:
parent.top.frames["mainFrameName"].location.href = parent.top.frames["mainFrameName"].location.href;

=========================================================
-jeff
try { succeed(); } catch(E) { tryAgain(); } finally { rtfm(); }
 
thanks!!

almost did the job fully. I also had to take care of keeping passed variables to the main frame in the form's action part.

(for those speaking PHP - I needed to keep the $GLOBALS but lose the $_POST vars :) )

again, thanks for the fast help.
 
OK, ran into another problem with this...

I use parent.top.main.location.href = parent.top.main.location.href; from another frame (menu) in the same window, and it works great until I open a pop up window. After that it doesn't work anymore, no matter if the pop up is open or not. It starts working again after loading a fresh page to 'main' frame.
The word 'main' is not mentioned anywhere in the pop up or in its opening (no override, if that's at all possible)

Did I miss something here? [3eyes]

Thanks!
 
try referencing it by index instead of name. for example, if it is the second frame defined in the frameset, then it is index 1

parent.top.frames[1].location.href = parent.top.frames[1].location.href;

also, see if you get any errors when using either method...try using mozilla firefox - it has better js error reporting.

=========================================================
-jeff
try { succeed(); } catch(E) { tryAgain(); } finally { rtfm(); }
 
[sad] still not working.
if I check what parent.top.main.location.href contains, I get the correct href and the firfox javascript console shows no errors, but the refreshing doesn't work...

weird.

thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top