Sha256: a91c6721c655f67e0b982c44b8e7762e925a35565de049d5f6a98146c3d9f900
Contents?: true
Size: 915 Bytes
Versions: 16
Compression:
Stored size: 915 Bytes
Contents
function handle_helpful_link(yesno) { $.ajax({ url: "http://chalkmark.herokuapp.com/api/helpful/vote/", data: {url: document.title, value: yesno}, dataType: "jsonp", success: function(data) { display_visit_stats(data); }} )}; function display_visit_stats(response) { yes_votes = response.true; no_votes = response.false; if (yes_votes > 0 || no_votes > 0) { $("#helpful").addClass("text-center").html("<small>votes so far: Yes: " + response.true + " No: " + response.false + "</small>"); } } $("#yes-link").click( function() { handle_helpful_link("yes");}); $("#no-link").click( function() { handle_helpful_link("no");}); function record_visit() { $.ajax({ url: "http://chalkmark.herokuapp.com/api/helpful/visiting/", data: {url: document.title}, dataType: "jsonp", success: function(data) { display_visit_stats(data) }} )}; $(function() { record_visit(); });
Version data entries
16 entries across 16 versions & 1 rubygems