1 / 5
Feb 2017

Hi



My site was using jQuery 3.1.1. But since the e-junkie code change there are issues. In Firefox and IE 11, the lightbox fails and so the cart opens in a new window (as if there was no js). Latest Chrome appears to be OK. I've not tried any other browsers.



I've had to down-grade jQuery to 2.2.4 and change <meta http-equiv="X-UA-Compatible" content="IE=edge" /> to <meta http-equiv="X-UA-Compatible" content="IE=10; IE=9" />.



Chrome 56.0:

jQuery 2.2.4: OK.

jQuery 3.1.1: OK.



Firefox 50.0.1:

jQuery 2.2.4: OK.

jQuery 3.1.1: the lightbox fails and so the cart opens in a new window (as if there was no js).



IE 11:

jQuery 2.2.4: document mode [edge] - the lightbox fails and so the cart opens in a new window (as if there was no js) - intermittently.

jQuery 2.2.4: document mode [10 or 9] - OK.

jQuery 3.1.1: document mode [edge] - the lightbox fails and so the cart opens in a new window (as if there was no js).

jQuery 3.1.1: document mode [10 or 9] - OK.

  • created

    Feb '17
  • last reply

    Feb '17
  • 4

    replies

  • 1.8k

    views

  • 2

    users

  • 8

    links

Thanks for bringing this to our attention; glad to hear you sorted out a solution, with our apologies for the inconvenience. Development is now investigating the conflicts you discovered. If you have any test pages still set up with these affected scenarios, we'd be glad to review those links as a test case where Dev can see what may be going on; feel free to email those links to us if you'd rather not post them here:

https://www.e-junkie.com/ej/contact.htm



One more thing you might try: replace "box.js" with "box_fb_o.js" in your View Cart code -- or, if you opt in to join our new cart beta, use "box_fb_n.js" instead. This will bypass the routine in box.js that determines which version of the cart your account is using, and respectively just loads only the old or new cart code directly.

I set up some test pages as below, just changing the meta http-equiv tag and jQuery version as appropriate.



<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="utf-8" />

<meta http-equiv="X-UA-Compatible" content="IE=Edge" />

<title>jQuery 3.1.1 | IE=Edge</title>

</head>

<body>

<h2>jQuery 3.1.1</h2>

<h2>meta http-equiv="X-UA-Compatible" content="IE=Edge"</h2>

<a class="ec_ejc_thkbx" href="https://www.e-junkie.com/ecom/gb.php?c=cart&cl=37&ejc=2" title="view cart">view shopping cart</a>

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>

<script type="text/javascript" src="https://www.e-junkie.com/ecom/box.js"></script>

</body>

</html>



I tried 'box_fb_o.js' instead of 'box.js', and everything worked.



I did some more checks and noticed that I hadn't included the 'onclick' on the ejunkie view cart link. I reverted back to 'box.js / IE Edge' and added the following below the other scripts:



<script type="text/javascript">

$('.ec_ejc_thkbx').click(function() {

return EJEJC_lc(this);

});

</script>



This also fixes it.



Something is preventing the ejunkie script adding the 'onlick' event (if it is missing) in Firefox / IE Edge if using jQuery 3.1.1.





Using 'box_fb_n.js' also works, but still loads the old cart (not the new one as suggested above).

Our script does not dynamically add 'onclick' attributes to cart buttons in the page; rather, that attribute is included with the standard cart button codes we provide in Seller Admin. When you copy these codes, make sure the box is ticked to "Get javascript cart buttons" (which should be the case by default), as unticking that box alters the code provided there to be suitable for pasting into sites where JS is not permitted.



It may be relevant in your case that our "box.js" includes jQuery 1.4 for use by our classic cart, whereas our new cart includes jQuery 3.1.1, so your issues might be simply a jQuery version conflict. It might be possible to resolve that by opting-in to use our new cart and loading "box_fb_n.js" directly. Note that using "box_fb_n.js" would not by itself enable the new cart on your page, as that is determined by joining your account to our new cart beta, as we recently announced here:

http://www.e-junkie.com/bb/topic/7270

Thank you for your response. I'll just revert back to jQuery 3.1.1 and IE=Edge with the below onclick event added:

<script type="text/javascript">

$('.ec_ejc_thkbx').click(function() {

return EJEJC_lc(this);

});

</script>

But it would be nice to know why 'box.js' is now broken.



E-junkieGuruOur script does not dynamically add 'onclick' attributes to cart buttons in the page; rather, that attribute is included with the standard cart button codes we provide in Seller Admin.




The test code I posted above does not include the 'onclick' attribute in the view cart anchor - it works with jQuery 2.2.4 loaded, but not jQuery 3.1.1 (in Firefox | IE Edge). The code on my site has not used the 'onclick' attribute for years, but has always worked fine until the recent change. Something must have been adding a click handler to the link.



It does seem odd that this works in Firefox | IE=Edge:

<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="utf-8" />

<meta http-equiv="X-UA-Compatible" content="IE=Edge" />

<title>jQuery 3.1.1 | IE=Edge</title>

</head>

<body>

<h2>jQuery 3.1.1</h2>

<h2>meta http-equiv="X-UA-Compatible" content="IE=Edge"</h2>

<a class="ec_ejc_thkbx" href=" https://www.e-junkie.com/ecom/gb.php?c=cart&cl=37&ejc=2 " title="view cart">view shopping cart</a>

<script type="text/javascript" src=" https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js "></script>

<script type="text/javascript" src="https://www.e-junkie.com/ecom/box fb_o.js"></script>

</body>

</html>



But this does not work in Firefox | IE=Edge:

<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="utf-8" />

<meta http-equiv="X-UA-Compatible" content="IE=Edge" />

<title>jQuery 3.1.1 | IE=Edge</title>

</head>

<body>

<h2>jQuery 3.1.1</h2>

<h2>meta http-equiv="X-UA-Compatible" content="IE=Edge"</h2>

<a class="ec_ejc_thkbx" href=" https://www.e-junkie.com/ecom/gb.php?c=cart&cl=37&ejc=2 " title="view cart">view shopping cart</a>

<script type="text/javascript" src=" https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js "></script>

<script type="text/javascript" src=" https://www.e-junkie.com/ecom/box.js "></script>

</body>

</html>



The only change is 'box.js'.



The below code from checkStatus.php (which is loaded by box.js) has the following; which appears to dynamically add 'onclick' events to 'a' or 'input' tags with a class of 'ec_ejc_thkbx' - if they're missing:



ejejc_jQuery('a.ec_ejc_thkbx,input.ec_ejc_thkbx').each(function(i) {

if (ejejc_jQuery(this).attr("href")) {

if (!ejejc_jQuery(this).attr("onClick")) {

ejejc_jQuery(this).click(function() {

return EJEJC_lc(this)

})

}

} else ...



E-junkieGuruIt may be relevant in your case that our "box.js" includes jQuery 1.4 for use by our classic cart, whereas our new cart includes jQuery 3.1.1, so your issues might be simply a jQuery version conflict.





I'm using the 'classic' version and 'box.js' - I use customisation and a minicart. I only tried the 'box_fb_n.js' for fault finding purposes (I thought I may need to enable the beta in my settings, but wasn't sure. Thanks for clearing that up.). As above, the 'box.js' version of jQuery did not conflict with jQuery 3.1.1 until the recent change. Also as above, 'box_fb_o.js' (which I assume also uses jQuery 1.4) does not conflict with jQuery 3.1.1.



A file comparison between 'box.js' and 'box_fb_o.js' does show differences.