|
-
Jun 19th, 2007, 06:26 AM
#1
Thread Starter
Frenzied Member
[RESOLVED] Javascript window.open()
Paypal has given me this snippet which is a image link that is supposed to open a new window on click to show that an item has been added to the shopping cart, but its not firing the new window up. Here it is:
Code:
<a href="#" onclick="window.open('https://www.paypal.com/cart/add=1&
[email protected]&item_name=oil+change+service&
item_number=1111&amount=29.99&image_url=http%3A//www.davesgarage.com/logo.gif&
return=http%3A//www.davesgarage.com/success.html&cancel_return=http%3A//www.davesgarage.com/cancel.html&
no_note=1','cartwin','width=600,height=400,scrollbars,location,resizable,status');">
<img src="http://images.paypal.com/images/sc-but-01.gif" border="0"></a>
Any ideas?
-
Jun 19th, 2007, 10:25 PM
#2
Re: Javascript window.open()
Do you have a pop-up blocker turned on? These sometimes block javascript from opening new windows.
-
Jun 20th, 2007, 10:20 AM
#3
Thread Starter
Frenzied Member
Re: Javascript window.open()
Yeah, normally FF tells me when a popup is being blocked and it doesn't when I do this. Doesn't work in IE either. The weird thing is if I use the simple examply on W3schools that uses a function it works fine on a normal URL but when I enter my long paypal URL it doesn't work.
-
Jun 20th, 2007, 12:58 PM
#4
Frenzied Member
Re: Javascript window.open()
 Originally Posted by the182guy
Paypal has given me this snippet which is a image link that is supposed to open a new window on click to show that an item has been added to the shopping cart, but its not firing the new window up. Here it is:
Code:
<a href="#" onclick="window.open('https://www.paypal.com/cart/add=1&
[email protected]&item_name=oil+change+service&
item_number=1111&amount=29.99&image_url=http%3A//www.davesgarage.com/logo.gif&
return=http%3A//www.davesgarage.com/success.html&cancel_return=http%3A//www.davesgarage.com/cancel.html&
no_note=1','cartwin','width=600,height=400,scrollbars,location,resizable,status');">
<img src="http://images.paypal.com/images/sc-but-01.gif" border="0"></a>
Any ideas?
You need to remove the CRLF (Carriage Return, Line Feed) from the end of each line of your code to keep the javascript on one line. I did this and was able to get your code working.
-
Jun 24th, 2007, 04:37 AM
#5
Thread Starter
Frenzied Member
Re: Javascript window.open()
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|