Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/86.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
jQuery-通过jQ加载页面_Jquery - Fatal编程技术网

jQuery-通过jQ加载页面

jQuery-通过jQ加载页面,jquery,Jquery,我想知道为什么这不管用了。。。它以前工作过,我看不出有什么问题 我想在单击带有class changePage的a href链接时,通过此脚本加载class container2中的页面 $(document).ready(function () { $(".changePage").click(function () { $(".container2").fadeOut("slow", function () { $(

我想知道为什么这不管用了。。。它以前工作过,我看不出有什么问题

我想在单击带有class changePage的a href链接时,通过此脚本加载class container2中的页面

$(document).ready(function () {

        $(".changePage").click(function () {

            $(".container2").fadeOut("slow", function () {
                $(this).load(href, function (responseText, status, req) {
                    if (status != "error") $(this).slideDown("slow");
                });
            });

            return false;

        });

    });
我想你想要:

$(document).ready(function () {

    $(".changePage").click(function () {
        var href = this.href; //<< define href here
        $(".container2").fadeOut("slow", function () {
            $(this).load(href, function (responseText, status, req) {
                if (status != "error") $(this).slideDown("slow");
            });
        });

        return false;

    });
});
$(文档).ready(函数(){
$(“.changePage”)。单击(函数(){

var href=this.href;//什么是
href