[squeak-dev] Altitude - Changes to AL-Rendering package stop AjaxCounterExample from working

Chris Cunnington smalltalktelevision at gmail.com
Mon Aug 20 19:00:04 UTC 2012


Changes to the AL-Rendering package allow for escape characters in tag 
attributes. The changes in ALHtml5Tag>>writeOpenInto: to produce that 
change (with the use of XTHtmlEntityWriteStream) but cause the 
AjaxCounterExample to stop working. The double quotes, ", become " 
and JavaScript becomes incomprehensible to the browser.

It looks like the following with ViewSource in a browser with the old 
package, the new package, and a simple solution.


AjaxCounterExample>>renderScriptsOn: with older Render package:

new Counter("/76S.tbklwPZckEDg94Zqgn7tB.-"); counter.install("#count", 
"#dec", "#inc");


AjaxCounterExample>>renderScriptsOn: with latest changer to Render package:

new 
Counter("""""/76S.tbklwPZckEDg94Zqgn7tB.-"""""); 
counter.install("#count", "#dec", "#inc");


AjaxCounterExample>>renderScriptsOn: with single quotes.

new Counter('/76S.tbklwPZckEDg94Zqgn7tB.-'); counter.install('#count', 
'#dec', '#inc');


The code in question is:

AjaxCounterExample>>renderScriptsOn:

[html text: 'var counter = new Counter("'.
html text: (html context registerResource: self resource) printString.
html text: '"); counter.install("#count", "#dec", "#inc");' ]

A simple solution could be to write JavaScript with pairs of single 
quotes instead of double quotes. '' instead of ". Just a thought.

Chris

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20120820/4046265f/attachment.htm


More information about the Squeak-dev mailing list