2010-11-29 3 views
0

このページで「Add to Bag」をクリックすると、毎回IE6がフリーズします。なぜそれが凍結しているのか分かりますか?誰かがより直接的な答えを持っていますか?なぜこのJavaScriptはIE6をフリーズしますか?

totallytrollbeads {}ドットコム{}スラッシュSafety0.html

function update() { 
    $.ajax({ 
     dataType: 'json', 
     type: 'POST', 
     url: '/cgi-bin/ajax_cart_count.cgi', 
     timeout: 2000, 
     success: function (data) { 
      // If bag is empty, it's see through. 
      if (data.cart_count == 0) { 
       $(".shopping_bag").css("opacity", ".2"); 
      } 
      // If bag is not empty, it's not see through. 
      else { 
       $(".shopping_bag").css("opacity", "1"); 
      } 
      $("#bag_total").html(data.grand_total); 
      $("#bag_count").html(data.cart_count); 
      window.setTimeout(update, 15000); 
     }, 
     error: function (XMLHttpRequest, textStatus, errorThrown) { 
      $("#bag_total").html('Timeout contacting server..'); 
      window.setTimeout(update, 60000); 
     } 
    }) 
} 
$(document).ready(update); 

// preparethe form when the DOM is ready 
$(document).ready(function() { 
    // bind form using ajaxForm 
    $('.add_to_cart_form').ajaxForm({ 
     beforeSubmit: loading, 
     success: myBox 
    }); 
}); 
// preparethe form when the DOM is ready 
$(document).ready(function() { 
    // bind form using ajaxForm 
    $('.add_to_cart_form').ajaxForm({ 
     beforeSubmit: loading, 
     success: myBox 
    }); 
}); 
// $(".add_to_cart_form").click(function() { 
// $('.bypass_add_to_cart_form').ajaxForm({ success: myBox }); 
// }); 

function loading() { 
    $("#loadingContent").show(); 
} 
function myBox(resptext, statustext) { 
    $("#loadingContent").hide(); 
    Boxy.ask(resptext, ["View Bag", "Continue Shopping"], function (val) { 
     if (val == "View Bag") { 
      document.location.href = "/cgi-bin/store.cgi?action=view_cart"; 
     } 
     if (val == "Continue Shopping" && product_detail == 1) { 
      history.go(-1); 
     } 
    }, { 
     title: "Add to Bag" 
    }); 
    $('.bypass_add_to_cart_form').ajaxForm({ 
     beforeSubmit: loading, 
     success: myBox 
    }); 
    update(); 
    return false; 
} 
/*  
This tells the ajax-style add to cart that  
it's on a product detail page so if the  
user clicks "Continue Shopping" it takes  
them back on step in their history.  
*/ 
$('.search_view').click(function() { 
    product_detail = 0; 
}); 
$('.product_view').click(function() { 
    product_detail = 1; 
}); 
+0

[バッグに追加]ボタンのコードを掲載できますか? – wajiw

+2

境界線のスパム...リンクを削除し、あなたが参照している動作を引き起こすコードを投稿することをお勧めします。コードにアクセスできない場合は、なぜこの質問を投稿していますか? – Jasarien

+0

迷惑メール。ページは正常に動作します。 –

答えて

1

それは外からすぐにフリーズする事をデバッグすることは容易ではありません。しかし、全体をクリーンアップし、必須ではないものを削除し、機能をチェックしてから次のステップを実行することは、常に良いアイデアです。

は、例えば、このために:

// preparethe form when the DOM is ready 
$(document).ready(function() { 
    // bind form using ajaxForm 
    $('.add_to_cart_form').ajaxForm({ 
     beforeSubmit: loading, 
     success: myBox 
    }); 
}); 
// preparethe form when the DOM is ready 
$(document).ready(function() { 
    // bind form using ajaxForm 
    $('.add_to_cart_form').ajaxForm({ 
     beforeSubmit: loading, 
     success: myBox 
    }); 
}); 

それが二回あり、この部分を持っていることを確認するために難しいことではありません。
&ペーストをコピーする代わりに、アプリケーションにもう少し正確を入れてください。

関連する問題