<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"><channel><title>Kid666 Blog - Latest Comments in Security; AJAX; JSON; Satisfaction</title><link>http://kid666.disqus.com/</link><description></description><language>en</language><lastBuildDate>Wed, 02 Jul 2008 09:36:00 -0000</lastBuildDate><item><title>Re: Security; AJAX; JSON; Satisfaction</title><link>http://kid666.com/blog/2006/12/23/security-ajax-json-satisfaction/#comment-796436</link><description>Valid JSON is an anonymous Javascript object. As such to be syntactically correct it requires assignment to a variable. This is why including raw JSON will create a syntax error.&lt;br&gt;&lt;br&gt;Arrays on the other hand got a bit of syntactic sugar added to make anonymous arrays valid to allow for multidimensional arrays. This means including an unassigned array object is valid Javascript (but not JSON).&lt;br&gt;&lt;br&gt;It should be noted though that 3rd party Javascript needs something like AdSafe or Caja to make it safe before you can consider using it on your page. 3rd party scripts can overload Object constructors or other functions to get access to private data.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">sh1mmer</dc:creator><pubDate>Wed, 02 Jul 2008 09:36:00 -0000</pubDate></item><item><title>Re: Security; AJAX; JSON; Satisfaction</title><link>http://kid666.com/blog/2006/12/23/security-ajax-json-satisfaction/#comment-793840</link><description>This is surprising to me.  I don't understand either why it doesn't parse, nor your explanation for why it does not parse.&lt;br&gt;&lt;br&gt;Look at this Spider Monkey session:&lt;br&gt;js&amp;gt; {"foo": "bar"}&lt;br&gt;typein:156: SyntaxError: invalid label:&lt;br&gt;typein:156: {"foo": "bar"}&lt;br&gt;typein:156: ......^&lt;br&gt;js&amp;gt; {quz: "quux"}&lt;br&gt;quux&lt;br&gt;js&amp;gt; ({quack: "like a duck"}).quack&lt;br&gt;like a duck&lt;br&gt;js&amp;gt; ({quack: "like a duck", jump: "like a kangaroo"}).quack&lt;br&gt;like a duck&lt;br&gt;js&amp;gt; ({quack: "like a duck", jump: "like a kangaroo"}).jump&lt;br&gt;like a kangaroo&lt;br&gt;js&amp;gt; ({"boo": "like a ghost"}).boo&lt;br&gt;like a ghost&lt;br&gt;js&amp;gt; ({"boo": "like a ghost", "flash": "like a firefly"}).flash&lt;br&gt;like a firefly&lt;br&gt;js&amp;gt; {"boo": "like a ghost"}&lt;br&gt;typein:165: SyntaxError: invalid label:&lt;br&gt;typein:165: {"boo": "like a ghost"}&lt;br&gt;typein:165: ......^&lt;br&gt;&lt;br&gt;&lt;br&gt;-So to me it appears that there is some grammatical construct which I'm unfamiliar with interfering with the general grammar of object literals.  Also, notice these work:&lt;br&gt;&lt;br&gt;js&amp;gt; x={"boo": "foo"}&lt;br&gt;[object Object]&lt;br&gt;js&amp;gt; var y = {"boo": "foo"}&lt;br&gt;js&amp;gt; y&lt;br&gt;[object Object]&lt;br&gt;&lt;br&gt;&lt;br&gt;I guess the next step is to read the javascript grammar to understand what's happening here.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">nejucomo</dc:creator><pubDate>Tue, 01 Jul 2008 22:51:27 -0000</pubDate></item></channel></rss>