0

I People

I have a Magento ver. 1.8.0.0 installed and works fine with the superfish menu dropdown. How ever every time I install a news system , I get all sorts of errors, can any one help?

Uncaught TypeError: Object #<Object> has no method 'on' bootstrap.js:156
(anonymous function) bootstrap.js:156
(anonymous function) bootstrap.js:158
Uncaught TypeError: Object #<Object> has no method 'superfish' superfish.js:124
(anonymous function) superfish.js:124
n jquery-1.7.min.js:2
o.fireWith jquery-1.7.min.js:2
e.extend.ready jquery-1.7.min.js:2
c.addEventListener.C jquery-1.7.min.js:2

It seems to have an issue with this line in superfish.js

jQuery(function(){
jQuery('.sf-menu').superfish()
})

Object # has no method 'superfish'

Any Ideas? Thanks Carl


I think the problem is that you have multiple instances of jquery in your page, for example if you load again jquery after superfish the superfish methods will no longer exist in the current jquery instance.

To solve this problem you need to edit your extensions/template configuration and load jquery only one time at the beggining before any jquery plugin.

Or you can use an extension that handles the jquery library like EasyjQuery: http://www.magentocommerce.com/magento-connect/easy-jquery.html

4

1 回答 1

2

我认为问题在于您的页面中有多个 jquery 实例,例如,如果您在 superfish 之后再次加载 jquery,则当前 jquery 实例中将不再存在 superfish 方法。

为了解决这个问题,你需要编辑你的扩展/模板配置,并且在任何 jquery 插件之前只加载一次 jquery。

或者您可以使用像 EasyjQuery 这样的处理 jquery 库的扩展:http: //www.magentocommerce.com/magento-connect/easy-jquery.html

于 2013-11-14T10:48:34.223 回答