Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- $("#removeButton").click(function(e){
- bootbox.confirm("Are you sure?", function(result) {
- if (result == true){
- $.ajax({
- type: "DELETE",
- async: true,
- contentType: "application/json",
- url: "/v1/item/" + itemID,
- dataType: "json",
- success:function(result){
- location.reload()
- },
- error:function(){
- $("#removeButton").notify("Error in removing item", "error");
- }
- });
- }
- else{
- console.log("false");
- }
- });
- </script>
- function removeConfirmButtonPressed(){
- $.ajax({
- type: "DELETE",
- async: true,
- contentType: "application/json",
- url: "/v1/items/" + itemID,
- dataType: "json",
- success:function(result){
- location.reload()
- },
- error:function(){
- $("#removeButton").notify("Error in removing item", "error");
- }
- });
- //event for clicking remove button
- $("#removeButton").click(function(e){
- bootbox.confirm("Are you sure?", function(result) {
- if (result == true){
- removeConfirmButtonPressed()
- }
- else{
- console.log("false");
- }
- });
- });
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement