Mr *_*ide 19 javascript methods ajax jquery post
我根据自己的经验使用了两种东西我在思考方法和类型都是POST和GET方法.
但看起来他们并不相似.
如果我使用type它正在工作我是serializeing一个表格数据..
如果我写method它不工作可以任何人解释他们之间的差异..?
$.ajax({
url: "controller.php",
type: 'POST',
method: "POST",
dataType: "json",
});
Run Code Online (Sandbox Code Playgroud)
帮助被挪用了.
Ste*_*lec 16
type(默认值:'GET')类型:String方法的别名.如果您使用的是1.9.0之前的jQuery版本,则应该使用type.
http://api.jquery.com/jquery.ajax/
Hos*_*sam 14
来自:http://api.jquery.com/jquery.ajax/
方法:
The HTTP method to use for the request (e.g. "POST", "GET", "PUT"). (version added: 1.9.0)
Run Code Online (Sandbox Code Playgroud)
类型:
An alias for method. You should use type if you're using versions of jQuery prior to 1.9.0.
Run Code Online (Sandbox Code Playgroud)