Skip to content

Instantly share code, notes, and snippets.

@rbaty-barr
Created September 24, 2018 15:54
Show Gist options
  • Save rbaty-barr/574926d217a392ce7457ea19768f11ee to your computer and use it in GitHub Desktop.
Save rbaty-barr/574926d217a392ce7457ea19768f11ee to your computer and use it in GitHub Desktop.
the jquery to call
$('#support').click(function () {
$(this).fadeOut();
$.ajax({
async: true,
type: "POST",
url: "/umbraco/surface/votenowsurface/castvote",
data: "1",
dataType: "html"
})
.done(function (data) {
Cookies.set('voted', '1', { expires: 365 });
//$('#progress').hide();
$('.share-it').fadeIn(500);
$('.hasVoted').fadeIn(500);
$(".notVoted").hide();
$(".count-title").text(data);
if (typeof console == "object") {
console.log("Message sent:" + data);
}
})
.fail(function (jqXHR, textStatus) {
$(".sorry").fadeIn();
$("#support").fadeIn();
if (typeof console == "object") {
console.log("Message failed:" + textStatus);
}
}).always(function() {
// if (typeof console == "object") {
// console.log("Message sent!");
// }
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment