[thelist] Weird window targetting problem with javascript links [SOLVED]

Roger Ly rogerly at bareviking.com
Wed Jan 15 17:43:02 CST 2003

>Now that I look at the PalPal code, I see:

><script language="JavaScript">
>	self.name = "paypal";

>You might want to see what happens if you name the window paypal
>instead of PayPal. But I doubt that would work.

OK, so I changed the test page
(http://members.evolt.org/rogerly/buy.html) so there are now four links.
The first two retain the javascript functionality with the first link
targeted at a window called "PayPal" while the second link is targeted
at "paypal".  The second set of links remove the javascript window.open
and rely solely on the target in the href being "PayPal" and "paypal"

Both links that target "PayPal" continue to open new windows each time
you click them.
Both links that target "paypal" work as I would like them to work (they
target the single window).

Don't know how I missed the renaming code on PayPal's side.

>But let's back way up - why are you using JavaScript to open the window
>in the first place? And backing further up, why do you want to open the
>link in a new window?

I am using Javascript so I can size the window a bit since the content
is designed to fit in a smaller window.  It's not apparent in the sample
code since I stripped off all the sizing parameters from window.open for
clarity's sake.  Also, since the shopping cart mechanism is on PayPal's
side, and I could possibly have several items on my page that I want to
add to the cart (each requiring a click), it allows a user to add to
their cart, and not got lost trying to get back to the store itself.

>I'm waiting for .jeff to chime in here ...
I know, I made sure that the links were still accessible to
non-Javascript browsers, though I guess forcing a new window on a user
(regardless of whether you are using javascript or not) isn't the best
experience for all users.



More information about the thelist mailing list