选项卡JS与快速购物的JS在IE浏览器冲突的问题?

2016-07-07 15:03 来源:www.chinab4c.com 作者:ecshop专家



选项卡的JS代码:
function $id(element) {
return document.getElementById(element);
}
function reg(str){
var bt=$id(str+"_b").getElementsByTagName("h2");
for(var i=0;i<bt.length;i++){
bt.subj=str;
bt.pai=i;
bt.style.cursor="pointer";
bt.onclick=function(){
$id(this.subj+"_v").innerHTML=$id(this.subj+"_h").getElementsByTagName("blockquote")[this.pai].innerHTML;
for(var j=0;j<$id(this.subj+"_b").getElementsByTagName("h2").length;j++){
var _bt=$id(this.subj+"_b").getElementsByTagName("h2")[j];
var ison=j==this.pai;
_bt.className=(ison?"":"h2bg");
}
}
}
$id(str+"_h").className="none";
$id(str+"_v").innerHTML=$id(str+"_h").getElementsByTagName("blockquote")[0].innerHTML;
}




快速购物的JS代码:
function orderQuick(goodsId)
{
var goods= new Object();
var spec_arr= new Array();
var fittings_arr = new Array();
var number = 1;
var formOrder= document.forms['ECS_FORMORDER'];

if (formOrder)
{
goods.spec_arr= getSelectedAttributes(formOrder);
goods.goods_id= goodsId;
goods.number = formOrder.elements['number'].value;
goods.country= formOrder.elements['country'].value;
goods.province= formOrder.elements['province'].value;
goods.city= formOrder.elements['city'].value;
goods.consignee = formOrder.elements['consignee'].value;
goods.email= formOrder.elements['email'].value;
goods.address= formOrder.elements['address'].value;
goods.tel = formOrder.elements['tel'].value;
if (formOrder.elements['zipcode']){goods.zipcode= formOrder.elements['zipcode'].value;}
if (formOrder.elements['mobile']){goods.mobile = formOrder.elements['mobile'].value;}
if (formOrder.elements['sign_building']){goods.sign_building = formOrder.elements['sign_building'].value;}
if (formOrder.elements['best_time']){goods.best_time= formOrder.elements['best_time'].value;}
if (formOrder.elements['postscript']){goods.postscript= formOrder.elements['postscript'].value;}
}
Ajax.call('order_quick.php?act=order', 'goods=' + goods.toJSONString(), orderQuickResponse, 'POST', 'JSON');
}


在火狐下可以正常提交订单,在IE下提交订单时提示页面有错误,elements为空或没有改对象,测试发现是这2段代码有冲突,怎样解决呢?请大家帮帮忙!!!

回答:
?????、、、、、

??????????????????

????????????????????

??????????????????

??????????????

感谢!!!!,我一直在等待回帖

?????????????

我把这段代码去掉也能提交订单了,但是选项卡切换不正常了。大家快来看看吧,怎样解决?
$id(str+"_h").className="none";
$id(str+"_v").innerHTML=$id(str+"_h").getElementsByTagName("blockquote")[0].innerHTML;

?????????????????

???????????