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

Refresh frames

Dreamweaver & Flash

Refresh frames

by  cjkenworthy  Posted    (Edited  )
I have a website with two frames:

Lefthand frame - tollbar, containing a field which keeps track of the number of items in a shopping cart.

Righthand frame - where things are added to the cart/taken away etc, where content changes.

I wanted to update the contents of one frame based on changes in another. Here's how I managed to update the contents of a frame from within another frame:

IF USING TEMPLATES !!!:
First of all make sure, if you're using templates, that you are allowed to edit the body tag, or other regions where you might need to add an event property e.g. 'onlick', or 'onload'. I was using a Dreamweaver template for the righthand frame where the content was, so it wouldn't let me set 'onload' properties in a page based on this template. To fix this, I edited the template and then set the event property in the template itself.

THE CODE:

I assigned the event property to the "body" (accessed by selecting it by name in the bottom left of the screen) and then opened up "behaviours" from the "window" menu. Then did a "Call Javascript" and typed in "onLoad" then in the 'javascript to call' entered:

window.parent.framename.location.reload(true);

where 'framename' is the name of the target frame to update.
You can put this code on any event and specify which frame to update.

As the template was the basis for all my content frames, when I saved the template it updated all the pages based on this to include this refresh code.

hey presto!
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top