且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用$阿贾克斯或$。员额致电MVC 5控制器的方法

更新时间:2023-02-25 16:41:30

您需要设置过程数据作为要发送的对象,这将需要被转换成一个查询字符串。

You need to set processData to true as you are sending an object which will need to be converted to a querystring.

从API:

过程数据
  默认情况下,该数据选择通过为对象(从技术上讲,任何String之外)将被处理并转换成一个查询字符串数据,拟合到默认的内容类型应用程序/ x-WWW的形式urlen codeD。如果您想发送一个DOM文档,或其他非处理的数据,将此选项设置为false。

ProcessData
By default, data passed in to the data option as an object (technically, anything other than a string) will be processed and transformed into a query string, fitting to the default content-type "application/x-www-form-urlencoded". If you want to send a DOMDocument, or other non-processed data, set this option to false.

http://api.jquery.com/jQuery.ajax/