+ -
当前位置:首页 → 问答吧 → jQuery的load怎么加载其他界面啊啊

jQuery的load怎么加载其他界面啊啊

时间:2011-07-03

来源:互联网

JScript code



$(document).ready(function() {
        $('#button').click(function(){
                       $('#content').load('html2.htm');
                       alert('加载完成!');
                       });
                 });

//为什么按下按钮以后,html2.htm没显示到id为cotent的层里面呢。。后面的 加载完成! 到时弹出来了


作者: qq83705563   发布时间: 2011-07-03

这个还真没经历过...

作者: kun00621   发布时间: 2011-07-03

http://jqapi.com/#p=load

应该放在回调函数里面
$('#result').load('ajax/test.html', function() {
  alert('Load was performed.');
});

作者: showenxxx   发布时间: 2011-07-03

JScript code

 $("#content").load("html2.htm");
       $("#content").ajaxSuccess(function(){
            alert('加载完成!');
       });
       $("#content").ajaxError(function(){
            alert('加载失败!');
       });


这样试试 。

你的代码alert肯定会弹出的 。

作者: zell419   发布时间: 2011-07-03

引用 3 楼 zell419 的回复:

JScript code

$("#content").load("html2.htm");
$("#content").ajaxSuccess(function(){
alert('加载完成!');
});
$("#content").ajaxError(function(){
alert('加载失败……
+1

作者: weike021996   发布时间: 2011-07-03