2008年10月19日星期日

Re: [fw-mvc] Zend_Dojo AJAX Requests

Hi,

Why should it? JSON is interpreted by a Javascript interpreter. Did you ever see that something like:

var text = 'My string with {} and ()';

Did not work in Javascript? Well, I don't ;).
Regards,  Pieter Kokx MaakSite.net PHP Developer 


Matthew Weier O'Phinney schreef:
-- Pieter Kokx <pieter@kokx.nl> wrote (on Saturday, 18 October 2008, 06:36 PM +0200):   
But about that JS expressions, what kind of problems can there be when I am putting my Javascript into a JSON string and using eval() to execute that?     
 Think function declarations. () and {} can cause issues and need to be escaped in a particular way. For more background, see the Zend_Json_Expr proposal:      http://framework.zend.com/wiki/display/ZFPROP/Zend_Json_Expr+to+allow+Javascript+Expressions+(functions)+to+be+encoded+using+Zend_Json    

没有评论: