Jquery not work but work after refresh -
i have jquery issue on page. click function not work when go on web page when refresh page click function working fine.
<script> jquery(document).ready(function($){ jquery("#cart-var<?php echo $id; ?>").click(function(e){ alert('hiii'); }); }); }); // <--- } , ) here! </script>
thanks, vivek
your code should this:
<?php if(!empty($id)): ?> <script> jquery(document).ready(function($){ jquery("#cart-var<?php echo $id; ?>").click(function(e){ alert('hiii'); }); }); </script> <?php endif; ?>
Comments
Post a Comment