我有一些jquery写的,在firefox和chrome中工作正常,但在IE中抛出一个错误。jquery IE错误
这里是代码的部分,当取出允许脚本的其他部分将正常运行......(否则整个文件不是由IE读取)
var product_qty_is_zero = ExternalCustom_product_qty_is_zero; //'import' external variable from view.phtml
var option_is_selected = false;
var options_exist = false;
if( ($(".options-container-big").length > 0) || ($(".options-container-small").length > 0) )
options_exist = true;
$('#main-button-btn-cart').mouseenter(function() {
//@ controlling backorder message
if(product_qty_is_zero)
{
$('#select-product-reminder').slideDown(300);
$('#select-product-reminder').text("product is purchaseable but on backorder");
$('#select-product-reminder').css("background-color", "#c3c3c3");
}
});
$('#main-button-btn-cart').click(function() {
if(!option_is_selected && options_exist)
$('#select-product-reminder').slideDown(300);
else
productAddToCartForm.submit();
});
$('#select-product-reminder').slideUp(300);
option_is_selected = true;
var image_info = ExternalCustom_image_info; //'import' variable from media.phtml
var image_link;
var $selected_value_variation = $('.selected').html();
for (var i = 0; i < image_info.length; i++)
{
if(image_info[i][0] == $selected_value_variation)
image_link = image_info[i][1];
}
$('#main-image').attr("href", image_link);
如果任何人都可以看通过它,看看是否有任何常见的IE标记错误,并给我一些提示,将不胜感激!
注*我已经尝试过的类和DIV扩展,如 $( 'div.options容器-大') 和 $( '#DIV主按钮BTN-车')
IE正在抛出什么错误,以及你在做什么导致它? – AlienWebguy
您是否启动了Javascript调试器来查看可能引发异常的位置? – Suroot
您的浏览器在问题中的偏好和判断是不必要的。 – N0Alias