--- a +++ b/monsters/licenses/Spaceship 2D | OpenGameArt.org_files/ajax_dlcount.js @@ -0,0 +1,16 @@ +(function ($) { + $(function() { + $('body').delegate('[data-fid]', 'mouseup', function() { + var fid = $(this).attr('data-fid'); + var url = '/file/' + fid + '/dlcounter'; + $.ajax({ + url: url, + success: function(data, textStatus, jqXHR) { + console.log(data); + $('span#dlcount-' + fid).html(data.dlcount); + } + }); + return true; + }); + }); +})(jQuery); \ No newline at end of file