私は完全なjquery初心者ですが、私はthis tutorial hereに従っています。
私はそれをすべて、すでに働いていたが、(と私も私が何をしたか分からない)今ではすべてがちょうど下がっている...
はここ(コメントを参照)スニペットです:
$(function() {
//This one here works and gets executed after the page has loaded
$.getScript("some link copied from one of the actual hrefs");
//Handler for some links that should load some js from the server and execute it
$('#searchresults .pagination a').live('click',
function(event) {
//This shows the correct link:
alert(this.href);
//However, this one doesn't even send a request:
$.getScript(this.href);
return false;
});
});
私はJQuery 1.5.2を使用しています。
また、私はデバッグの目的でFireQueryをインストールしましたが、サイトをロードするたびに「jQuery(...) called incorrectly
」と私に衝撃を与えています。リンクの1つをクリックすると、「When I called jQuery.get(...) with your args, an error was thrown! TypeError: rootjQuery is undefined
」と表示されます。
私のjquery.jsファイルが壊れている可能性があると思ったので、私は新鮮にダウンロードしてインストールしました。そこには運、しかし...万が一、あなたが別のドメインからgetScript()しようとしていることで
感謝任意のヘルプ、THX
URLを$ .getScriptにハードコードしてみてください(ここに警告URLを貼り付けてください)。 URLが有効なパスかどうかを確認します。 – nolabel