2008年10月18日星期六

Re: [fw-mvc] Zend_Dojo AJAX Requests

-- 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

--
Matthew Weier O'Phinney
Software Architect | matthew@zend.com
Zend Framework | http://framework.zend.com/

没有评论: