[問題] jQuery的js檔 import問題

看板Ajax作者 (Krel)時間17年前 (2008/10/24 10:43), 編輯推噓1(101)
留言2則, 2人參與, 最新討論串1/1
請問各位 $(document).ready(function(){ $("#nav-one li").hover( function(){ $("ul", this).fadeIn("fast"); }, function() { } ); if (document.all) { $("#nav-one li").hoverClass ("sfHover"); } }); $.fn.hoverClass = function(c) { return this.each(function(){ $(this).hover( function() { $(this).addClass(c); }, function() { $(this).removeClass(c); } ); }); }; 像這樣的jQuery,將它另存為js。希望主頁內碼能短一點,因此想import它 如:<script type="text/javascript" src="js/xxxx.js"></script> 但卻沒有效果,請問是方法不對嗎? 請各位指教 ^^ -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 118.170.1.10 martone:轉錄至看板 Web_Design 10/24 10:44

10/24 10:44, , 1F
用Firebug看前端頁面是否真的有載入這個 js 檔案
10/24 10:44, 1F

10/24 13:38, , 2F
是否放在載入jQuery之後
10/24 13:38, 2F
文章代碼(AID): #190JPKyB (Ajax)
文章代碼(AID): #190JPKyB (Ajax)