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.

javascript window

the window object represents window containing dom document; document property points dom document loaded in window


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -