Hi I'm a bit stuck here, i cant seem to be able to include the javascript file in my cmsms template.
<script src="js/slides.min.jquery.js"></script>
<script>
$(function(){
$('#slides').slides({
preload: true,
preloadImage: 'img/loading.gif',
play: 5000,
pause: 2500,
hoverPause: true
});
});
</script>
This code doesent work, it neither includes the js/slides.min.jquery.js nor does it run the script,, can any one please explain how javascript is included in cmsms templates...
Hi I'm a bit stuck here, i cant seem to be able to include the javascript file in my cmsms template.
<script src="js/slides.min.jquery.js"></script>
<script>
$(function(){
$('#slides').slides({
preload: true,
preloadImage: 'img/loading.gif',
play: 5000,
pause: 2500,
hoverPause: true
});
});
</script>
This code doesent work, it neither includes the js/slides.min.jquery.js nor does it run the script,, can any one please explain how javascript is included in cmsms templates...
Share Improve this question asked Apr 15, 2011 at 10:23 Umer HassamUmer Hassam 1,3285 gold badges23 silver badges42 bronze badges1 Answer
Reset to default 13You need to include the javascript in {literal}
tags, to avoid cmsms trying to parse it. This is an example (from one of my sites), that includes the Google analytics javascript.
{literal}
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXXXX-X']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics./ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
{/literal}