Javascript {literal}

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Post Reply
Keithb
Forum Members
Forum Members
Posts: 15
Joined: Mon Aug 02, 2010 7:27 pm

Javascript {literal}

Post by Keithb »

I have a js slider that I'm using in a template and the next/previous isn't displayed, and firefox keeps shouting that $ is undefined with the $(function() line;

Code: Select all

 {literal} <!-- Site JavaScript -->
                <__script__ type="text/javascript" src="js/jquery-1.3.1.min.js"></__script>
                <__script__ type="text/javascript" src="js/jquery.easing.1.3.js"></__script>
                <__script__ type="text/javascript" src="js/jquery.ennui.contentslider.js"></__script>
                <__script__ type="text/javascript">
                    $(function() {
                    $('#one').ContentSlider({
                    width : '920px',
                    height : '200px',
                    speed : 800,
                    easing : 'easeInOutBack'
                    });
                    });
                </__script>
                 {/literal}
I added the {literal} but it doesn't appear to help.  This code is in the body of the template.  Am I doing something wrong?
Last edited by Keithb on Mon Aug 23, 2010 8:16 pm, edited 1 time in total.
spike
Forum Members
Forum Members
Posts: 153
Joined: Thu Sep 25, 2008 5:02 pm

Re: Javascript {literal}

Post by spike »

Okay so that's the code you're using in the template presumably before the last body tag.
What's the code you're using on the actual page ?

see here:
http://ennuidesign.com/demo/contentslider/#
go to view source.
Keithb
Forum Members
Forum Members
Posts: 15
Joined: Mon Aug 02, 2010 7:27 pm

Re: Javascript {literal}

Post by Keithb »

This code would be part of every page, and is in the static template.  The individual page doesn't have any javascript in it unless that is not what you are referring to.  I may have some css and path problems for images also.
Keithb
Forum Members
Forum Members
Posts: 15
Joined: Mon Aug 02, 2010 7:27 pm

Re: Javascript {literal}

Post by Keithb »

After looking at my source, I only see:

Code: Select all

<__script__ type="text/javascript">
                    $(function() );
                    });
                </__script>
It's dropping the other info for some reason.  Newbie problems I presume.
nuno

Re: Javascript {literal}

Post by nuno »

Code: Select all

<!-- Site JavaScript -->
                <__script__ type="text/javascript" src="js/jquery-1.3.1.min.js"></__script>
                <__script__ type="text/javascript" src="js/jquery.easing.1.3.js"></__script>
                <__script__ type="text/javascript" src="js/jquery.ennui.contentslider.js"></__script>
              {literal}
                <__script__ type="text/javascript">
                   $(document).ready(function() {
                    $('#one').ContentSlider({
                    width : '920px',
                    height : '200px',
                    speed : 800,
                    easing : 'easeInOutBack'
                    });
                    });
                </__script>
                 {/literal}
UPDATE:
http://www.learningjquery.com/2006/09/i ... ment-ready
Last edited by nuno on Tue Aug 24, 2010 1:26 pm, edited 1 time in total.
Post Reply

Return to “The Lounge”