我有以下几点:我可以使用jQuery简化这个ajax调用吗?
$.ajax({
type: "POST",
traditional: true,
url: "/Administration/Locations/DoAction",
data: { partitionKey: id.substring(14),
rowKey: id.substring(4, 14),
action: ac,
datastore: $("#DataSource").val()
},
async: false,
dataType: "json",
timeout: 1000,
success: function (data) {
xx
},
error: function (x, t, m) {
xx
}
可以,我可以使用jQuery使后简化这个?请注意,id和ac是较早分配的javascript变量。
简化什么办法吗?这是非常简单的代码,但可能会在其他代码的上下文中进行更改。你能解释一下你的问题吗? – Bojangles
你想简化一下吗?看起来相当原始/简单。 – Shomz
'async:false'击败了ajax的目的。 – AlienWebguy