将jQuery AJAX与传统的true一起使用会很好吗? [英] Is it good to use jQuery AJAX with traditional true?

查看:122
本文介绍了将jQuery AJAX与传统的true一起使用会很好吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,我不知道传统的Ajax设置是什么意思, 其次,在ASP MVC中是否需要将其设置为true?

First, I don't know what traditional means in Ajax setting, Second, is there any case we need set it to be true in ASP MVC?

基于名称,我相信它会很快贬值吗?不是吗?

Based on the name, I believe it's going to be depreciated soon? Isn't it?

推荐答案

jQuery API文档

http://api.jquery.com/jQuery.Ajax/# jQuery-ajax设置

传统

类型:布尔

如果您想使用 参数序列化的传统样式.

Set this to true if you wish to use the traditional style of param serialization.

下面让我们看看,tranditional标志更改了参数发送到服务器的方式

Let's have a look below, tranditional flag changes the way how parameters are sent to the server

对于PHP开发人员

$.ajax(url, {
   data : { a : [1,2,3] },
   traditional : false
}));
// `data` are sent as "a[]=1&a[]=2&a[]=3"

对于ASP.NET MVC开发人员

$.ajax(url, {
   data : { a : [1,2,3] },
   traditional : true
}));

// `data` are sent as "a=1&a=2&a=3"

如您所见,根据您的服务器端语言设置traditional标志很重要.

As you can see, it is important to set traditional flag depending on your server side language.

所以我想,在不久的将来它不会被弃用.

So I guess, it won't be deprecated anytime in near future.

这篇关于将jQuery AJAX与传统的true一起使用会很好吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆