Page 1 of 1

getting error with jquery? - SOLVED

Posted: Fri Feb 24, 2012 9:46 pm
by darksaga
Hey guys,

I'm building a site using the foundation responsive design framework and they have a slick little jquery slide show they use. I've uploaded and linked all the JS files correctly, but I'm getting an error when it's trying to load the slideshow with the function:

Code: Select all

<__script__ type="text/javascript">
     $(window).load(function() {
         $('.slide-show').orbit();
     });
</__script>
And I'm getting this error:

Code: Select all

string(135) "Smarty error: [in tpl_body:23 line 97]: syntax error: unrecognized tag: $('.slide-show').orbit(); (Smarty_Compiler.class.php, line 446)" string(111) "Smarty error: [in tpl_body:23 line 97]: syntax error: unrecognized tag '' (Smarty_Compiler.class.php, line 590)"
I'm wondering why I'm getting this error. Any help would be greatly appreciated.

thanks,

D

Re: getting error with jquery?

Posted: Fri Feb 24, 2012 9:59 pm
by Wishbone
JavaScript uses curly brackets. So does Smarty. Smarty wins, and declares a syntax error. Wrap your JavaScript with {literal} {/literal} tags.

Re: getting error with jquery?

Posted: Sat Feb 25, 2012 8:31 pm
by darksaga
Brilliant! Thanks for the tip, I'll keep this mind for next time.

D