Created
September 24, 2018 15:54
-
-
Save rbaty-barr/574926d217a392ce7457ea19768f11ee to your computer and use it in GitHub Desktop.
the jquery to call
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#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