Advertisement
Guest User

jquery post

a guest
Jul 7th, 2015
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. <?php foreach ($this->data['tablet_data'] as $tablet):?>
  2. <div class="goods">
  3. <a href="<?=base_url();?>to_cart/<?=$tablet['goods_id'];?>" id="to_cart">В корзину</a>
  4. </div>
  5. <?php endforeach;?>
  6. <script type="text/javascript">
  7. $(document).ready(function(){
  8. $("a#to_cart").click(function(event) {
  9. event.preventDefault();
  10. $.post($("a#to_cart").serialize(),
  11. function(data) {
  12. location.reload();
  13. });
  14. });
  15. });
  16. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement