javascript - jQuery Code not loading -
i debugging jquery code , have found section of code not firing when clicked.
my html/php is:
$cartlink .= "<a class='add_to_cart button' data-id='{$product->id}' href='javascript:;' {$style}>{$label}</a>";
jquery:
<script> jquery(window).on('click', 'a.add_to_cart.button', function() { console.log("batman"); }); </script>
you need replace window
document
. because window
object doesn't contain dom nodes. can jquery(window.document)
dom nodes.
the window object represents window containing dom document; document property points dom document loaded in window
Comments
Post a Comment