作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
好的,当您“继续结帐”时,它会为您提供以下列表:
默认情况下,结帐方法应该下拉,当您点击“继续”时,帐单信息将下拉,类似于:http://www.plazathemes.com/demo/ma_musicgear/index.php/checkout/onepage/
但是,当我转到该页面时,结帐方法不会下拉,每当我点击它时,什么也没有发生。现在这些都是我的 JS 错误:
Uncaught TypeError: Object [object Object] has no method 'attachEvent' prototype.js:5644
2
Uncaught TypeError: Object [object Object] has no method 'attachEvent' prototype.js:5653
Uncaught TypeError: Object [object Object] has no method 'setAttribute' clearchannel.halfoffdeals.com/index.php/checkout/onepage/:349
Uncaught TypeError: Object [object Object] has no method 'attachEvent' prototype.js:5644
Uncaught TypeError: Object [object Object] has no method 'observe' opcheckout.js:236
Uncaught TypeError: Object [object Object] has no method 'setAttribute' clearchannel.halfoffdeals.com/index.php/checkout/onepage/:544
Uncaught TypeError: Object [object Object] has no method 'observe' opcheckout.js:374
Uncaught TypeError: Object [object Object] has no method 'observe' opcheckout.js:537
Uncaught TypeError: Object [object Object] has no method 'getElementsByTagName' prototype.js:5010
Uncaught TypeError: Object [object Object] has no method 'attachEvent' prototype.js:5653
Uncaught TypeError: Object [object Object] has no method 'attachEvent' prototype.js:828
Uncaught TypeError: Object [object Object] has no method 'dispatchEvent'
这些与此有什么关系吗?由于 Bootstrap ,我从原型(prototype)中获取了所有的 attachEvent 和 blah blah。我不知道如何解决这个问题,所以我目前将其搁置。我猜 setAttribute 肯定是导致问题的原因?
感谢任何帮助..
我不知道这是否有任何帮助,但在您点击“继续结帐”之前的购物车页面上,它在 ESTIMATE SHIPPING AND TAX 下列出了“州/省”标签,但没有选择/输入box.. 所以它在结帐页面上显示为无效的 region_id:
因此 SetAttribute 错误来自此部分:
<div class="field">
<label for="shipping:region" class="required"><em>*</em>State/Province</label>
<div class="input-box">
<select id="shipping:region_id" name="shipping[region_id]" title="State/Province" class="validate-select" style="display:none;">
<option value="">Please select region, state or province</option>
</select>
<script type="text/javascript">
//<![CDATA[
$('shipping:region_id').setAttribute('defaultValue', "");
Uncaught TypeError: Object [object Object] has no method 'setAttribute'
//]]>
</script>
<input type="text" id="shipping:region" name="shipping[region]" value="" title="State/Province" class="input-text " style="display:none;" />
</div>
</div>
它说 $('shipping:region_id') 没有方法 setAttribute..
最佳答案
@ROMMEL 帮助解答了这个问题。这些是我为解决问题所采取的步骤:
jQuery.noConflict();
完成! =) 犯了很多错误,人们说 Bootstrap 和原型(prototype)相互干扰。发出 noConflict() 后所有这些错误都消失了!
关于javascript - 结帐页面上的 Magento setAttribute 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17973132/
我是一名优秀的程序员,十分优秀!