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.