Web Hosting Talk







View Full Version : Refreshing a shopping cart pop up window


darksoap
09-28-2003, 06:41 PM
The below script is for a shopping cart.

onclick="window.open('https://www.paypal.com/cart/display=1&business=orders%mybusinessname.com','cartwin','width=600,height=400,scrollbars,lo cation,resizable,status');">

The problem is when some keeps shopping and selects another item it opens a new window, and does not refresh the current on.

I have done some basic research I have been unable to find a way to refresh this expect using the child and parent commands and I am just not sure if that will work in this set of circumstances.


Thanks

Darksoap.

Burhan
09-29-2003, 02:09 AM
window.open returns a handle to the child window that you can use to reload the content.

This should work (untested) :



handle = window.open( ... );
handle.location.href='somefile.html'

anglo_aussie
10-20-2003, 09:51 AM
for older browsers, you may need to put the handle in as a second param too:

handle = window.open (url, "handle", "width=.....");
handle.location.href='soefile.html';

I've found that NS4.x doesn't work unless this is in there - but then who's coding for NS4.x nowadays :-)