JavaScript Error in Template

lmwatson's Avatar

lmwatson

17 Mar, 2011 05:02 PM

I am trying to insert the following JS in the head section of our template and this is the message I receive:

An error occurred during editing: The entity name must immediately follow the '&' in the entity reference.

I have tried attaching the JS through a format block and Xhtml block with the <!--#START-CODE code which affects other JS and CSS.
Any other ideas?

JS file attached also:

http://m.rollins.edu




  1. 1 Posted by Kris on 17 Mar, 2011 06:05 PM

    Kris's Avatar

    The problem is that your template must be valid XHTML and Cascade's parser sees that & as an entity reference. What you need to do is add CDATA tags inside your script tags but you can't just add regular CDATA tags either. Here is what I use:

    <script type="text/javascript">
        /*<![CDATA[*//*---->*/
    
        JS Code here
    
        /*--*//*]]>*/
    </script>
    

    Hope that helps,
    Kris

  2. 2 Posted by lmwatson on 17 Mar, 2011 06:09 PM

    lmwatson's Avatar

    We will give it a try

    Thanks,
    Linda

  3. Tim closed this discussion on 21 Jun, 2011 03:44 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac