0

以下の jQuery があります。「$.get(page+".php", function(html))」行でエラーが発生します。私は最新のjQueryバージョンを使用しています。

$(function() {
    $("tabs a").click(function() {

    $("#tabs li").removeClass("selected");
    $(this).parent("li").addClass("selected");

    var page = this.hash.substr(1);
    $("#content").html("");
    $.get(page+".php", function(html)) {
        $("#content").html(html);
    }
    });

    if(location.hash) ? $("a[href="+location.hash+"]").click() : $("#tabs a:first").click();
    }
});

私はこのチュートリアルに従っています: http://www.youtube.com/watch?v=nBbkTmQHh3M あの人はエラーを起こしません。構文エラーがあるため、Dreamweaver はその行を強調表示します。

前もって感謝します。

4

4 に答える 4

2

ここに構文エラーがあります:

$.get(page+".php", function(html)) {
                            //   ^ This is extra
    $("#content").html(html);
}
});

する必要があります

$.get(page+".php", function(html){
    $("#content").html(html);
});
// } was extra
于 2013-06-26T03:12:48.950 に答える
0

いくつかの構文エラーがあります:

$.get(page+".php", function(html)) { <-- extra )
    $("#content").html(html);
} <--- missing );

への変更:

$.get(page+".php", function(html) {
    $("#content").html(html);
});
于 2013-06-26T03:12:51.870 に答える
0

エクストラ)}

$.get(page + ".php", function(html) { // <-- extra ) here
    $("#content").html(html);
}); // <-- extra } here
于 2013-06-26T03:13:16.650 に答える
0

これは...

$.get(page+".php", function(html) {
    $("#content").html(html);
}
});
于 2013-06-26T03:13:28.413 に答える