make jsvars declaration xhtml and html compatible
authorFabrice <fabrice@secondweb.fr>
Tue, 28 Jul 2009 10:19:14 +0200
changeset 2554 3b6a6d2f9d7e
parent 2553 1abdcb4199af
child 2555 ca7b122f34fa
make jsvars declaration xhtml and html compatible
utils.py
--- a/utils.py	Tue Jul 28 17:36:30 2009 +0200
+++ b/utils.py	Tue Jul 28 10:19:14 2009 +0200
@@ -255,10 +255,10 @@
         # 1/ variable declaration if any
         if self.jsvars:
             from simplejson import dumps
-            w(u'<script type="text/javascript">\n')
+            w(u'<script type="text/javascript"><!--//--><![CDATA[//><!--\n')
             for var, value in self.jsvars:
                 w(u'%s = %s;\n' % (var, dumps(value)))
-            w(u'</script>\n')
+            w(u'//--><!]]></script>\n')
         # 2/ css files
         for cssfile, media in self.cssfiles:
             w(u'<link rel="stylesheet" type="text/css" media="%s" href="%s"/>\n' %