gpt4 book ai didi

jquery - 从 jquery 中的 .ajax() 函数获取数据

转载 作者:行者123 更新时间:2023-12-01 06:56:08 25 4
gpt4 key购买 nike

我正在使用 .ajax() 函数在页面上调用并向其传递数据。我不明白的是如何获取数据并在调用的页面中使用它。是否有一个函数可以调用来收回数据?

最佳答案

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

$.ajax({
url: "test.html", //give your URL here
data: {name:"your name"} , //(optional) if you wish you can send this data to server, just like this.
success: function(data){
$('body').prepend(data); //here is your data
}
});

关于jquery - 从 jquery 中的 .ajax() 函数获取数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8794192/

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