[Twisted-web] liveevil problem: nested functions get lost
Federico Di Gregorio
fog at initd.org
Mon Feb 28 16:09:01 MST 2005
Il giorno lun, 28-02-2005 alle 14:17 -0800, Donovan Preston ha scritto:
> > Another little problem: isn't liveevil.js missing an eval() call on the
> > handler extra arguments?
>
> No; python string literals are now treated as javascript string
> literals. To produce a javascript string which won't get quoted (and
> thus will be evaled when it arrives in the browser) you should now use
> the nevow.livepage.literal string wrapper. The name "literal" will
> probably change to "js" or something more suitable soon. (Suggestions
> please?)
So the string won't be evaluated in the context of the
nevow_clientToServerEvent() function but directly in the event call,
isn't it? So hanlders like:
handler(mycallable, "node.value")
should now be written:
handler(mycallable, liveevil.js("this.value"))
substituting "this" to "node"? It is fine for me and even the "js" name
is not too bad (i.e., I can't think of anything better right now.)
federico
--
Federico Di Gregorio http://people.initd.org/fog
Debian GNU/Linux Developer fog at debian.org
INIT.D Developer fog at initd.org
Nessuno dice che non si possa sognare in dettaglio, essere realistici
e magari realizzarlo pure, il sogno. -- <dani>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Questa parte del messaggio =?ISO-8859-1?Q?=E8?= firmata
Url : http://twistedmatrix.com/pipermail/twisted-web/attachments/20050301/84963003/attachment.bin
More information about the Twisted-web
mailing list