views:

506

answers:

5

GET:$.get(..)

POST:$.post()..

What about PUT/DELETE?

+5  A: 

You could use the ajax method:

$.ajax({
    url: '/script.cgi',
    type: 'DELETE',
    success: function(result) {
        // Do something with the result
    }
});
Darin Dimitrov
+2  A: 

$.ajax will work.

$.ajax({
   url: 'script.php',
   type: 'PUT',
   success: function( response ) {
   }
});
Jacob Relkin
+2  A: 

Seems to be possible with JQuery's ajax function by specifying

type: "put" or type: "delete"

and is not not supported by all browsers, but most of them.

Check out this question for more info on compatibility:

Are the PUT, DELETE, HEAD, etc methods available in most web browsers?

Pekka
A: 

ajax()

look for param type

Other HTTP request methods, such as PUT and DELETE, can also be used here, but they are not supported by all browsers.

antpaw
A: 

You should be able to use jQuery.ajax :

Load a remote page using an HTTP request.


And you can specify which method should be used, with the type option :

The type of request to make ("POST" or "GET"), default is "GET".
Note: Other HTTP request methods, such as PUT and DELETE, can also be used here, but they are not supported by all browsers.

Pascal MARTIN