View Full Version : Simple Javascript coding question

01-19-2003, 09:18 AM
I have a website with a shopping cart (Tznius.com) and currently, whenever a customer adds their first item to a shopping cart, a new window pops up (Paypal) and is visible to the user. What usually happens though is that the user minimizes this window and goes back to the referrring window (my website) and continues shopping. If they try to add another item to the shopping cart though, what happens is that the item is added to the minimized window.

So.... I'm here to ask if someone could please send me directions of how to make it such that when a person adds any item to the shopping cart, the 'minimized' window pops up again. This may not even be a Js question, it may just be an html question.

Thank you and awaiting your replies!

- Miriam

01-19-2003, 04:50 PM
you could use focus!
if you knew what the window name is called. (?)
you could use
<window name>.focus()
And then it will focus that window back up.

01-19-2003, 05:18 PM
That is correct. Instead of just using

window.open('paypal stuff here')

Use this instead to make the window an object:

myWin = window.open('paypal stuff here');

Then, focus the window (it will pop to the top):

if(window.myWin) window.myWin.focus();