gpt4 book ai didi

jQuery 帖子加载

转载 作者:行者123 更新时间:2023-12-01 07:35:28 26 4
gpt4 key购买 nike

我有2个函数$.post jQuery,如何使第二个$.post仅在第一个$.post加载完全完成后执行?但我不能在 $.post 中使用 $.post 因为第二个 $.post 是从 flash 调用的

function play(id, file, dur, who, hname, artist, song)
{
if($.cookie('scrobb') == 'on')
{
setTimeout(function(){
$.post("/scrobbling/", { nowplaying: 1 , artist: artist, song: song, duration: dur},function(){});
}, 5000);
}
}

function songIsOver()
{
if($.cookie('scrobb') == 'on')
{
$.post("/scrobbling/", { submission: 1 , artist: bartist, song: bsong, duration: bdur},
function(data){});
}
}

抱歉英语不好=)

最佳答案

您可以使用第一篇文章的回调函数:

$.post('ajax/first.html', function(data_first) {
$.post('ajax/second.html', function(data_second) {
$('.result').html(data_second);
});
});

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

关于jQuery 帖子加载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2266296/

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