2012-06-04 89 views
1

我相信我的網站上有一個jQuery的衝突。但我不明白如何使用螢火蟲進行調試。firebug指向jquery錯誤,但我不知道如何解決錯誤

當從購物車頁面點擊「計算運輸和處理鏈接」時,結果從不顯示。

要做到這一點,您需要先將商品添加到購物車http://www.musicforte.com/sheet_music/,然後點擊頁面右上方的「購物車」。

我的螢火看到「堅持」查看「控制檯」的時候是一個紅色的X,並且有上的jquery.js線錯誤141

我如何能理解的衝突和解決問題?

我修改了代碼以包含一個id到計算運輸按鈕建議,但仍然沒有運氣。這裏是使用的代碼:

我試着給Calculate Shipping按鈕添加一個ID。但它並沒有解決問題。我修改了代碼如下:

<a href="#" class="EstimateShippingLink" onclick="Cart.ToggleShippingEstimation(); return false;"><em>%%LNG_CalculateShippingHandling%%</em></a> 
         <div class="EstimateShipping" style="display: none;"> 
          <div class="EstimatedShippingMethods" style="display: none;"> 
           <div class="ShippingMethodList"> 
           </div> 
           <hr /> 
          </div> 
          <dl> 
           <dt>%%LNG_Country%%:</dt> 
           <dd> 
            <select style="width:200px;" name="shippingZoneCountry" id="shippingZoneCountry" onchange="Cart.ToggleShippingEstimateCountry();"> 
             %%GLOBAL_ShippingCountryList%% 
            </select> 
           </dd> 

           <dt>%%LNG_StateProvince%%:</dt> 
           <dd> 
            <select style="display: %%GLOBAL_ShippingHideStateList%%" style="width:200px;" name="shippingZoneState" id="shippingZoneState"> 
             %%GLOBAL_ShippingStateList%% 
            </select> 
            <input style="display: %%GLOBAL_ShippingHideStateBox%%" type="text" class="Textbox Field200" name="shippingZoneStateName" id="shippingZoneStateName" value="%%GLOBAL_AddressState%%" /> 
           </dd> 

           <dt>%%LNG_ZipPostcode%%:</dt> 
           <dd><input type="text" class="Field100 Textbox" name="shippingZoneZip" id="shippingZoneZip" value="%%GLOBAL_ShippingZip%%" /></dd> 
          </dl> 
          <p class="Submit EstimateShippingButtons"> 
           <span style="display:inline-block;padding-right: 10px;vertical-align:top;"><a href="#" onclick="Cart.ToggleShippingEstimation();">%%LNG_Cancel%%</a> %%LNG_or%% </span><input type="image" class="formBtn" src="%%GLOBAL_TPL_PATH%%/images/%%GLOBAL_SiteColor%%/CalculateShipping.gif" onclick="Cart.EstimateShipping();" value="%%LNG_CalculateShipping%%" id="fixshipping" /> 
          </p> 
         </div> 
+0

在此處至少放置一個屏幕截圖 – zerkms

+0

您還需要注意Firebug中顯示的狀態代碼。這是從服務器返回請求的狀態碼; 500錯誤表示服務器端存在異常,依此類推。 –

回答

0

問題是你的嵌入模塊的形式裏面,當你點擊圖像輸入它做瀏覽器的默認,並提交整個形式,不只是你的航運領域,並導致頁面重新加載。

我相信這個錯誤是由於ajax被中止。

我在控制檯跑了這一點,並能得到航運Calcs(計算)返回無刷新頁面,或錯誤

$('.EstimateShippingButtons input').click(function(){ 
    return false; 
}) 

你可能想提高選擇,也許增加一個ID您shiiping Calcs(計算)提交按鈕

編輯:其實只需要添加return falseevent.preventDefault()到您現有的處理程序

在cart.js添加它結束Cart.EstimateShipping

+0

添加的功能,你需要修改我的答案底部 – charlietfl

+0

我一定是做錯了。在cart.js中,我現在有: 接近函數的結尾。我做錯了嗎? – osakagreg

+0

只需加上'return false;'即可結束功能 – charlietfl

相關問題