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...
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?
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?
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.
精彩评论