Re:JSON: The JavaScript subset that isn't
by rimantas on Monday May 16, 2011 @06:35AM
(#2552139)
You are mixing eval() with other stuff.
[ Parent
| on HN ]
Re:JSON: The JavaScript subset that isn't
by threedaymonk on Monday May 16, 2011 @07:16AM
(#2552199)
Or, conversely, everyone here is confusing eval() with evaluation in general. JSONP does not call eval() as such, but it does evaluate the server response as JavaScript, because it ends up as:
<script src="/whatever?callback=foo"></script>
The source of which is something like foo({"a":"b"})
Therefore, the hash supplied to foo() must be valid JavaScript.