Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JQuery function doesn't work on Chrome on Mac, but works on Chrome on Win 7 and all other browsers

Reference this page: http://www.ivault.sg/nproduct.php?pid=116&cat=2

Selecting an option on the dropdown box by the side should change the href of 'Add to Cart'.

However this does not happen specifically on Chrome on Macs, but works on all other browsers, even on Chrome in Windows.

like image 926
JC Lee Avatar asked Oct 10 '22 09:10

JC Lee


1 Answers

Instead of the "click" event, use "change", as in

$("#productOptions").change(function(){
    var id=$(this).attr("value");

    if (id != "") {
        $("#productAddToCart").attr("href","addtocart.php?code="+id);
    }
});
like image 194
Rafael Steil Avatar answered Oct 13 '22 09:10

Rafael Steil