jQuery 帖子加载
我有 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){});
}
}
抱歉英语不好 =)
I have 2 functions $.post jQuery, how to make the 2nd $.post carried out only after the loading of the first $.post completely finished?
But I can not use $.post within $.post because the second $.post called from 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){});
}
}
Sorry for bad english =)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用第一篇文章的回调函数:
http://api.jquery.com/jQuery。发布/
You could use the callback function of the first post:
http://api.jquery.com/jQuery.post/