Skip to content

Instantly share code, notes, and snippets.

@rionmonster
Created April 28, 2016 19:16
Show Gist options
  • Save rionmonster/8e716246a68255299d50b4401fcf07c1 to your computer and use it in GitHub Desktop.
Save rionmonster/8e716246a68255299d50b4401fcf07c1 to your computer and use it in GitHub Desktop.
<button class='Remove' data-id='42'>Click Me!</button>
<script src="https://code.jquery.com/jquery-2.1.4.js"></script>
<script>
$(function(){
$('.Remove').click(function () {
debugger;
var myId = $(this).data('id');
$.ajax({
url: '@Url.Action("Remove", "ReadingNow")?Book_id=' + myId,
success: function (response) {
$('#myElem').html(response).fadeIn('slow');
$('#myElem').delay(8000).fadeOut('slow');
},
failure: function (response) {
alert("Failure");
}
});
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment