views:

71

answers:

1

It says about the type option of the jQuery.ajax() method that

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.

So...

  1. Does that mean that PUT and DELETE won't work if the browser does not support it, or just that PUT and DELETE can not be done natively by the user in the browser?

  2. If I can't or shouldn't use those, what do people usually do instead? Send the method as a a GET or POST parameter instead? Or?

+2  A: 

PUT and DELETE won't work if the browser doesn't support it. The usual workaround is to do a POST request with an extra field that holds the method (e.g. _method="PUT" in the POST values). Some web frameworks (Spring MVC, Ruby on Rails) will do this kind of thing for you.

JacobM