當我試圖通過ShrinkSafe縮小我的JavaScript文件,一個真棒縮小工具,它輸出一個空文件,這意味着我的JavaScript文件顯然包含錯誤?儘管在五種瀏覽器中都是完美的。所以我試着JSLint,另一個真棒網站,因此發現了數百個我糾正了大部分的樣式錯誤,但我不知道修復這些錯誤。這些是風格提示,哪些可能是遺留的潛在錯誤?ShrinkSafe minify工具抱怨:通過JSLint調試javascript代碼:樣式還是真實錯誤?
非常感謝您的風格或對這些問題的錯誤糾正提示。
JS LINT說,這些是
錯誤問題在管線38字符55:缺少radix參數。
if (settings.crossLinking && location.hash && parseInt(location.hash.slice(...
問題在管線39字符32:缺少radix參數。
var currentPanel = parseInt(location.hash.slice(1));
問題在線路46字符30: 'currentPanel' 是已經定義。
var currentPanel = settings.firstPanelToLoad;
問題在管線47字符24: '偏移' 已定義。
var offset = - (panelWidth*(currentPanel - 1));
問題在管線53字符30: 'currentPanel' 是已經定義。
var currentPanel = 1;
問題在線108字符33:缺少radix參數。
if (sliderCount === parseInt($(this).attr("rel").slice(12))) {
問題在線111字符35:缺少radix參數。
targetPanel = parseInt($(this).attr("href").slice(1));
問題在線125字符55:缺少radix參數。
if (settings.crossLinking && location.hash && parseInt(location.hash.slice(...
問題在管線137字符45: 'currentPanel' 使用超出範圍。
panelHeight = $('.panel:eq(' + (currentPanel - 1) + ')', slider).height();
在管線150字符73問題:預期 ';' ,而是看到「滑塊」。在線路
panelHeight = $('.panel:eq(' + x + ')', slider).height()
問題161角色32: '偏移' 已定義。在管線168字符69
var offset = - (panelWidth*currentPanel);
問題: '偏移' 使用超出範圍。
$('.panel-container', slider).animate({ marginLeft: offset }, settings.sl...
+1這個真棒鏈接!那很好地顯示了錯誤! – Sam 2011-03-14 05:33:09
那麼錯誤是什麼? :-) – 2011-03-14 06:27:26
HARD ERROR實際上並非上述「風格改進」硬性錯誤就像'float:'right'',它必須是'「float」:「right」'對於某些.css屬性,在沒有錯誤報告,它精美和神奇地縮小到一個小小的快樂炒編碼:) – Sam 2011-03-14 07:06:54