is there a way to send a DELETE request from a website, using xmlhttprequest or something similar?
A:
I believe that both PUT and DELETE are not implemented (in the case of Prototype) due to flaky browser support.
seengee
2009-12-15 16:41:47
+3
A:
This can be done with jQuery
, if you don't mind the dependence on a framework. I believe jQuery
uses XmlHttpRequest
to perform this action. You'd use the $.ajax
function with the type
parameter set to DELETE
.
Please note that not all browsers support HTTP DELETE requests.
Tim S. Van Haren
2009-12-15 16:42:39
A:
You can use php to do this:
setup your XMLHTTPRequst to call a phpscript that deletes a named file, and then pass the filename that you intend to be removed to the php script and let it do its business.
MikeEL
2009-12-15 16:47:34
+3
A:
As someone mentioned above, jQuery will do this for you, via the following syntax:
$.ajax({
type: "DELETE",
url: "delete_script.php"
data: "name=someValue",
success: function(msg){
alert("Data Deleted: " + msg);
}
});
Mike Trpcic
2009-12-15 16:51:46