Advertisement
twinfacer

jQuery list ajax manipulation

Jun 17th, 2013
398
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 0.39 KB | None | 0 0
  1. $(document).ready ->
  2.   $('#cart .close-btn').click ->
  3.     line_item = $(this)
  4.     $.ajax
  5.       type: 'DELETE'
  6.       url: line_item.data('href')
  7.       success: (data) ->
  8.         line_item.closest('tr').fadeOut()
  9.         stats = data.split(',')
  10.         $("#cart_link").find("span").text("(" + stats[1]+ ")")
  11.         $('#cart tr.total td.total.price').text('Total: $' + stats[0])
  12.     false
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement