1

少しガイドが必要です。ページが完全に読み込まれるまで、これらの 2 つの関数の実行を遅らせるか、5000 ミリ秒後に時限爆弾を実行しようとしています。

最新のjquery 1.6を使用しています

あなたの助けとコードスニペットを前もってありがとう:)

$("a.siteNavLink").each(function() {
   var _href = $(this).attr("href"); 
   $(this).attr("href", _href + '?p=client');
});
$("a.footernav").each(function() {
   var _href = $(this).attr("href"); 
   $(this).attr("href", _href + '?p=client');
});
4

2 に答える 2

3

使用できます

$(window).load(function(){ your code here }) // page has loaded including images 

また

$(document).ready(function(){ your code here }) // dom has loaded 
于 2011-10-02T19:17:18.850 に答える
2
$(document).ready(function() {
  // Your code here
});

これにより、ドキュメントが完全に読み込まれたときにのみコードが実行されます

jQueryready()ドキュメント

于 2011-10-02T19:17:12.543 に答える