Javascript Popup Window in the HTML on a category/product

For general questions and discussions specific to the AbleCommerce GOLD ASP.Net shopping cart software.
Post Reply
skinsfan99
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 45
Joined: Wed May 25, 2016 3:32 am

Javascript Popup Window in the HTML on a category/product

Post by skinsfan99 » Wed Jun 08, 2016 4:57 am

I am trying to use JavaScript to display a popup window from either a category or product page. When I edit the HTML and add the following code the popup window works fine, but I am not getting the scroll bars. Why?

Here is my code:

<a onclick="MyWindow=window.open('http://dev.perelandra-ltd.com/Bottle-Bu ... llbars=yes'); return false;" href="#">Click Here</a>

Thank you!!

User avatar
Katie
AbleCommerce Admin
AbleCommerce Admin
Posts: 2651
Joined: Tue Dec 02, 2003 1:54 am
Contact:

Re: Javascript Popup Window in the HTML on a category/product

Post by Katie » Wed Jun 08, 2016 8:21 am

Hello,

Can you provide a link to the page that has this code added?

Thanks
Katie
Thank you for choosing AbleCommerce!

http://help.ablecommerce.com - product support
http://wiki.ablecommerce.com - developer support

skinsfan99
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 45
Joined: Wed May 25, 2016 3:32 am

Re: Javascript Popup Window in the HTML on a category/product

Post by skinsfan99 » Wed Jun 08, 2016 10:45 am

Katie,

Here is the link: http://dev.perelandra-ltd.com/Animal-Ca ... W5589.aspx

The 'Click Here' is at the very top. I just used this as a test page. Once it is working there are quite a few places where we will be implementing this feature.

Thank you!!

User avatar
Katie
AbleCommerce Admin
AbleCommerce Admin
Posts: 2651
Joined: Tue Dec 02, 2003 1:54 am
Contact:

Re: Javascript Popup Window in the HTML on a category/product

Post by Katie » Wed Jun 08, 2016 2:32 pm

The pop-up scrolls if you use Google Chrome, but it doesn't if you use Firefox.

I'm not that familiar with Javascript. You might try to do some google searches to see if FF requires different code.

Thanks
Katie
Thank you for choosing AbleCommerce!

http://help.ablecommerce.com - product support
http://wiki.ablecommerce.com - developer support

skinsfan99
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 45
Joined: Wed May 25, 2016 3:32 am

Re: Javascript Popup Window in the HTML on a category/product

Post by skinsfan99 » Tue Jun 14, 2016 6:10 am

Firefox does require a different syntax. You must supply a value for the href parameter.

Here is the updated code that now works on Firefox and IE. I also added code that centers the popup on the screen. If you don't want it centered use the second example.

Centered on screen:
<p><a onclick="window.open('/Bottle-Buyers-Club-Membership-C1218.aspx','license','width=1000px,height=600px,left=' + ((screen.width - 1000) / 2) + ',top=' + (screen.height - 600) / 2 + ',resizable=1,scrollbars=yes,toolbar=no,menubar=no,location=no,directories=no');;return false" href="/Bottle-Buyers-Club-Membership-C1218.aspx">Membership Subscription Agreement</a></p>

Not centered on screen:
<p><a onclick="window.open('/Bottle-Buyers-Club-Membership-C1218.aspx','license','width=1000px,height=600px,resizable=1,scrollbars=yes,toolbar=no,menubar=no,location=no,directories=no');;return false" href="/Bottle-Buyers-Club-Membership-C1218.aspx">Membership Subscription Agreement</a></p>


I hope this helps.
Thanks

Post Reply