[Seaside] Issue with JSScript code generated in a render
John Toohey
jt at parspro.com
Thu Mar 4 19:50:04 UTC 2010
I ran into an issue pushing data and a script via Comet to a brower.
My render generated correct HTML, plus this code :-
<script type=\"text/javascript\">/*<![CDATA[*/$(\"#hp169\").spinner({min:1,max:99,step:0.25,increment:\"fast\",skipInitialChange:true,showOn:\"always\"})/*]]>*/</script>")
This looks okay, but both FF and Chrome generate an error while
parsing it. FF mentions "unterminated string" and Chrome complains of
an Invalid TOKEN. I reduce the code to :-
$("#markettable").prepend(
"<script></script>"
);
but this still gives an error.
However, adding escaping the final forward / in the script tag fixes
this. I found a lot of reports of this issue on the net, and the
consensus seems to be to always escape a forward / whilst emitting JS
to the browser. Having trouble finding the method that generates the
tags, do anyone know where that is?
--
-JT
More information about the seaside
mailing list