lib/shortener/server/public/js/site.js in short-0.5.4 vs lib/shortener/server/public/js/site.js in short-0.6.0

- old
+ new

@@ -11,11 +11,11 @@ $.each($(this).serializeArray(), function(i, field) { formData[field.name] = field.value; }); /* Send the data using post and put the results in a div */ - $.post( this.action + '.json', formData, function( data ) { + $.post( this.action, formData, function( data ) { $( "#display-new-shorts" ).append( data.html ); } ); $('#nav-add-form > input[name="shortener[url]"]').val(""); @@ -23,10 +23,10 @@ }); $('.delete-button').click(function(event){ event.preventDefault(); var btn = $(this); - $.get(this.href + '.json', function(data){ + $.post(this.href, function(data){ if (data.success === true) { // fadeOut on a tr doesn't work, but on td it does. btn.parent().parent('tr').find('td').fadeOut(); // we don't explicitly need to do this, because next time the page // loads it won't be there. plus, it breaks our fadeout