【发布时间】:2013-08-01 03:23:01
【问题描述】:
好的,当您“继续结帐”时,它会为您提供以下列表:
- 结帐方法
- 帐单信息
- 运输信息
- 运送方式
- 付款信息
- 订单审核
默认情况下,结帐方式是下拉的,当你点击“继续”时,账单信息会像这样下拉: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'
其中任何一个与此有关吗?由于引导程序,我从原型中获得了所有的 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..
【问题讨论】:
-
我认为你的 jQuery 和原型正在发生冲突。尝试从
$('shipping:region_id')更改为$$('#shipping:region_id')只需在<script type="text/javascript">之后添加这个$j=jQuery.noConflict()所以而不是$jQuery 的别名现在是$j -
所以如果我包含 bootstrap.min.js 很多页面将无法工作?该代码是 Magento 附带的,因此我必须更改许多其他地方。太麻烦了。。还有其他解决办法吗?如果主题使用 bootstrap.css,可以不使用 bootstrap.min.js 吗?
-
你能提供你的网站网址吗?
-
被服务器屏蔽了,但你是对的! =) 把它放在一个 jquery-noconflict.js 文件中: jQuery.noConflict();并在我的 jQuery.js 文件之后添加它,一切都很好! =) 过去一周我无法消除的所有这些错误也消失了 =)
标签: javascript jquery magento magento-1.7