cohen
cohen

Reputation: 621

Blogger wont save template with this javascript in it

The template wont save when I have this piece of javascript in it:

    var minutes = secs / 60;
    var seconds = secs % 60;

     if ( seconds<10 ) {
            var extrazero = &quot;:0&quot;
    }
    else {
             extrazero = &quot;:&quot;
    }

I have narrowed it down to the < symbol in the condition. If I change that to an = sign it saves but if I have the < symbol there it has an error saying the following:

Error parsing XML, line 2741, column 16: The content of elements must consist of well-formed character data or markup.

EDIT: I found someone saying that putting cdata tags around the javascript worked for them. it does save but doesnt work.

    //<![CDATA[   javascript here   //]]>

Upvotes: 1

Views: 535

Answers (1)

Code Spy
Code Spy

Reputation: 9954

simply Parse your Javascript code Here http://www.blogcrowds.com/resources/parse_html.php then paste in Blogger :)

Upvotes: 2

Related Questions