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.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.