gpt4 book ai didi

ajax - Jquery 中的 Ajax.updater 相当于什么?

转载 作者:行者123 更新时间:2023-12-03 22:20:51 24 4
gpt4 key购买 nike

请让我知道 Jquery 中以下原型(prototype)代码的等效内容。

var myAjax = new Ajax.Updater('abc', '/billing/add_bill_detail', {
method: 'get',
parameters: pars,
insertion: Insertion.Bottom
});

我想使用 Jquery 执行相同的操作。

提前致谢。

最佳答案

在 jQuery 中,Ajax 将使用如下:

$.ajax({
url: "/billing/add_bill_detail",
type: "get",
dataType: "html",
data: {"pars" : "abc"},
success: function(returnData){
$("#abc").html(returnData);
},
error: function(e){
alert(e);
}
});

如果 abc 是 div 的 id,则使用 #abc;如果 abc 是类,则使用 .abc。

您可以将 returnData 放置在 HTML 中您想要的位置,

关于ajax - Jquery 中的 Ajax.updater 相当于什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15565203/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com