开发者

Javascript Errors for A New Widget on Magento

开发者 https://www.devze.com 2023-04-12 17:13 出处:网络
I have just installed this new widget for our products called Nivo Slider, This has been throwing an error in the windowonload and as such changed it from the default code on the download of:

I have just installed this new widget for our products called Nivo Slider,

This has been throwing an error in the windowonload and as such changed it from the default code on the download of:

    <script type="text/javascript">
$(window).load(function() {
    $('#slider').nivoSlider();
});
</script>

to

<script type="text/javascript"> 
var windowOnload=window.onload||function(){};window.onload=function(){windowOnload();  {
    $('#slider').nivoSlider();
};}

I am now getting the error of 'null' is null or not an object Line: 150 Char: 9

Any help on this as I have never really worked on javascript? Website link is www.开发者_如何学运维gadgetfreakz.co.uk/tom

Regards


If you're going to use jQuery you'll probably need to put it into No Conflict mode so it doesn't interfere with Prototype (Magento uses it). Easiest thing I found is to just make a jquery-compat.js file with the line

var $j=jQuery.noConflict();

And include that file. Then you can use $j(...) where you would normally use $(...)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号