Javascript files not being loading in backend
Hi,
We are creating a new website in the latest version (v5.02860) of Sitefinity and have implemented the NivoSlider. This works fine until we log into the backend and go to the homepage where the slider is and we get the error "Error: Object doesn't support this property or method". After investigating the jquery.nivo.slider.pack.js include is never loaed on the page on the admin backend hence the nivoslider function on the masterpage causes the error.
This previously worked fine in Sitefinity 4.4 so something seems to have changed somewhere.
Just to give a snippet of how this originally worked in Sitefinity 4.4:
<
sf:ResourceLinks
ID
=
"resourcesLinks"
runat
=
"server"
>
<
sf:ResourceFile
JavaScriptLibrary
=
"JQuery"
/>
</
sf:ResourceLinks
>
<
script
src
=
"/js/jquery.nivo.slider.pack.js"
type
=
"text/javascript"
></
script
>
<
script
type
=
"text/javascript"
>
$(window).load(function ()
$('#slider').nivoSlider(
effect: 'slideInLeft',
pauseTime: 8000
);
);
</
script
>
<
sf:JavaScriptEmbedControl
ID
=
"script1"
runat
=
"server"
ScriptEmbedPosition
=
"InPlace"
Url
=
"~/NivoSlider/jquery.nivo.slider.pack.js"
/>
Richard,
<script type=
"text/javascript"
>
jQuery(window).load(
function
()
jQuery(
'#slider'
).nivoSlider(
effect:
'slideInLeft'
,
pauseTime: 8000
);
);
</script>
Hi Tim,
Tried this but it made no difference.
thanks
Well, that's disappointing.
Are you familiar with jQuery conflicts? That may be what's going on but I'm not sure. I load jQuery in through the master page using Google CDN. Sometimes, I get conflicts...especially when using certain controls. In those instances, I have to make sure that I $.noConflict() to get access to scripts that were loaded in prior.
Hopefully that works out! :)
Thanks,
I don't think that there are any conflicts as the JQuery library is loading but not the jquery.nivo.slider.pack.js in the admin mode.
Richard, did you get this working? I need to implement an image slider and the Nivo Slider looks like a good option.
Hi Jeremy,
I didn't, I followed the Falafel link in my first post although when on the page in the admin backend the slider doesnt show which isn't a huge deal and it's better than having errors.
thanks
Richard, thanks for replying. I ended up implementing the WOW Slider in a widget control. It was quite easy, although I admit I'm using several static images so it's not wired into the Sitefinity galleries. I imagine it wouldn't be too difficult to add that functionality.