tag:help-archives.hannonhill.com,2010-02-09:/discussions/general/70-no-subjectCascade CMS: Discussion 2018-10-18T20:36:00Ztag:help-archives.hannonhill.com,2010-02-09:Comment/24945962010-08-06T17:24:52Z2010-08-06T17:24:52ZIncluding jquery syntax code<div><p>Hi Steve,</p>
<p>It is likely complaining because it sees <code><div id="navCycle"></code> with no closing <code></div></code> tag. Try wrapping your code in <a href="http://www.hannonhill.com/kb/Code-Sections/#passthrough-code-sections">passthrough code sections</a>.<br />
</p>
<p>Let me know if that helps!</p></div>Timtag:help-archives.hannonhill.com,2010-02-09:Comment/24945962010-08-06T17:33:51Z2012-10-15T15:14:41ZIncluding jquery syntax code<div><p>using version - 6.7 - r14254</p>
<p>I tried the passcode using a text and xhtml block. it's
outputted with the start-code and end-code in the html view.</p>
<!--#START-CODE <script type ="text/javascript">
$("document").ready(function(){
$('#featured-event-in').after('<div id="navCycle">').cycle({
fx: 'scrollLeft', speed: 300, timeout: 3500, pause: 1, next:
'#next2', pager: '#navCycle' }); }) </script> #END-CODE--></div>ssuhtag:help-archives.hannonhill.com,2010-02-09:Comment/24945962010-08-06T18:12:04Z2010-08-06T18:12:04ZIncluding jquery syntax code<div><p>Generally, I would wrap the contents of that script inside CDATA tags within your actual script tags if I were putting it in a page.</p>
<p>Alternatively, you could save the content of that script as a Javascript file and the link to the file.</p>
<p>As a developer who likes scripts separated from html, I would do the second. But the first method works for me.</p></div>Pennytag:help-archives.hannonhill.com,2010-02-09:Comment/24945962010-08-06T19:40:53Z2012-10-15T15:14:41ZIncluding jquery syntax code<div><p>Why is the start-code not being processed though?</p></div>ssuhtag:help-archives.hannonhill.com,2010-02-09:Comment/24945962010-08-06T21:23:57Z2010-08-06T21:23:57ZIncluding jquery syntax code<div><p>I did not have this issue and I just tested it with your code in my instance of 6.7. I just put the START-CODE and END-CODE tags around the script. It looks like in the sample above your end p tag and beginning to the h1 tag got wrapped into your pass through code. I am not sure if this is an issue with code displaying properly in this site.</p>
<p>Also worth-noting, if you are going to use pass through code, that script will not execute in Cascade but it will on your published site.</p>
<p>I hope this helps.</p></div>Pennytag:help-archives.hannonhill.com,2010-02-09:Comment/24945962010-08-09T13:14:44Z2010-08-09T13:14:44ZIncluding jquery syntax code<div><p>Alternatively, what we do is add a text field to our pages, dump the JS snippet into the field, and then spit it out into a region within our template. This will allow you to use your JS within Cascade.</p>
<p>There is a drawback; however. It seems as though sometimes conditionals are rewritten with HTML entities, causing the JS to error. For example, the most common occurrence is with < and >, you'll get see their entity representation.</p>
<p>To get around this, we have an additional file asset include so that we can simply include a JS file, rather than throw the code in the text field. We use some XSLT to add the script tag into a template region. This will also let you see the JS working within Cascade.</p></div>ryan.griffithtag:help-archives.hannonhill.com,2010-02-09:Comment/24945962010-08-09T15:05:31Z2012-10-15T15:14:41ZIncluding jquery syntax code<div><p>What version of the cms are u running?</p>
<p>using version - 6.7 - r14254</p></div>ssuhtag:help-archives.hannonhill.com,2010-02-09:Comment/24945962010-08-09T15:11:44Z2010-08-09T15:11:44ZIncluding jquery syntax code<div><p>We're on v6.4.6, but that method should work just fine for v6.7. Not sure about the entities problem, though, since we're not able to test with that version yet.</p></div>ryan.griffithtag:help-archives.hannonhill.com,2010-02-09:Comment/24945962010-08-11T17:24:42Z2010-08-11T17:24:42ZIncluding jquery syntax code<div><p>we usually use external js files for jquery scripts like this and refer to them in a block placed in a head tag or end of body region. If it's simple or short jquery, I can usually paste it in the HTML box of an XHTML block without a problem.</p>
<p>This was working in both 6.4.6 and our current 6.7.1</p></div>johnsons4tag:help-archives.hannonhill.com,2010-02-09:Comment/24945962010-08-12T18:27:03Z2012-10-15T15:14:42ZIncluding jquery syntax code<div><p>Well it turns out i was not closing my - end-code correctly.</p>
<p>thanks for all your help!</p></div>ssuh