javascript - adding/deleting items from a list and updating the total -


i'm building akin shopping cart adding items shortlist.

i need add item cart , update cart count , display added item in modal window (i'm planning on using reveal plugin zurb).

thus far, i've got adding cart working i'm not yet able update count (without refreshing page) or display modal.

http://jsfiddle.net/x7azn/2/

$('a.add-to-shortlist').on('click',function(){   $.ajax({   url: $(this).attr('data-href'),   success: function(data) {            verb = data['verb'];       total_items = data['total_items'];       alert('item added shortlist');   } });   // stop event propagation here  return false; }); 

help appreciated.

to change text following e.preventdefault() call, put following within function -

  e.preventdefault();    $(this).text('remove list'); 

Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -