Last active
March 11, 2020 03:13
-
-
Save lucassmacedo/17fc8c9dfbd12b40284e31be14f9f133 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
$.ajax({ | |
url: 'http://localhost/item/1/delete', | |
type: 'DELETE', | |
dataType: "JSON", | |
data: { | |
"id": 1, | |
}, | |
headers: { | |
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') | |
}, | |
success: function (data) { | |
console.log(data); | |
//$("#url" + url_id).remove(); | |
}, | |
error: function (data) { | |
console.log('Error:', data); | |
} | |
}); |
$.ajax({
url: 'http://localhost/item/' + id,
type: 'DELETE',
data: {
"id": id,
"_token": $('meta[name="csrf-token"]').attr('content')
},
success: function (data) {
console.log(data);
},
error: function (data) {
console.log('Error:', data);
}
});
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Outra coisa é, melhora o verbo para DELETE http://localhost/item/1