I have a url like: http://localhost:8080/myapp/discussions/voteup?id=1
which returns the following json:
{"vote":{"value":"100"}}
I am trying to make a JQuery Ajax Call to post a vote to the url.
$(function(){
$(".vote-up-post").click(function() {
var postId = $("#postId");
alert("Post Value" + postId.val());
$.ajax({
type: "GET",
url: "/myapp/discussions/voteup",
data: {'id': postId.val()},
dataType: "json",
success: function(response){
$(".post-votes-count").text("100");
},
error: function(response){
alert("Error:" + response);
}
});
});
});
I get the the following pop up for the second alert message:
Error:[object XMLHttpRequest]
Any idea what I am missing?