Javascript 在另一个jQuery脚本之后运行jQuery
我使用Javascript 在另一个jQuery脚本之后运行jQuery,javascript,jquery,Javascript,Jquery,我使用curl从网页获取HTML并显示在我的一个页面上: $("document").ready(function() { $("#content").load("curl.php .auction_list_closed"); }); 返回内容后,我希望运行另一个脚本。加载内容后,如何运行另一行jQuery?函数接受第二个参数,即完成后执行的函数 $("document").ready(function() { $("#content").load("curl.php .
curl
从网页获取HTML并显示在我的一个页面上:
$("document").ready(function() {
$("#content").load("curl.php .auction_list_closed");
});
返回内容后,我希望运行另一个脚本。加载内容后,如何运行另一行jQuery?函数接受第二个参数,即完成后执行的函数
$("document").ready(function() {
$("#content").load("curl.php .auction_list_closed", function(){
startSecondScript();
});
});
.load()
函数接受一个函数作为第二个参数,该函数在完成后执行
$("document").ready(function() {
$("#content").load("curl.php .auction_list_closed", function(){
startSecondScript();
});
});
您可以将回调作为参数传递给
load()
方法:
或
您可以将回调作为参数传递给
load()
方法:
或
不太确定,但我相信您可以简单地添加一个回调函数。可以找到更多信息 例如:
$("document").ready(function() {
$("#content").load("curl.php .auction_list_closed", function() {alert("data was loaded")});
});
不太确定,但我相信您可以简单地添加一个回调函数。可以找到更多信息 例如:
$("document").ready(function() {
$("#content").load("curl.php .auction_list_closed", function() {alert("data was loaded")});
});
在回调方法中添加代码
$("#content").load("curl.php .auction_list_closed", function() {
//do your stuff here.
});
在回调方法中添加代码
$("#content").load("curl.php .auction_list_closed", function() {
//do your stuff here.
});
为什么不直接获取HTML?出于好奇,
.auction\u list\u closed
代表什么?我以前没有见过这种语法。为什么不直接获取HTML呢?只是出于好奇,.auction\u list\u closed
代表什么?我以前从未见过这种语法。