Monday, April 16, 2012

Ajax doesn't trigger server action

I am trying to trigger action via ajax but it doesn't call from some reason. Is my js code fine?



@Html.ActionLink("LIKE", "LikeComment", "Comments", new { id = 1985 }, new{@class = "likeButton"})

$(document).ready(function () {
$(".likeButton").click(function () {
$.ajax({
url: $(this).data("action-url"),
cache: false,
success: function (html) {
alert('ss');
}
});
return false;
});
});




No comments:

Post a Comment