[Twisted-web] Error: nevow_clientToServerEvent is not defined
(Firefox JS Console)
Michael M
m.milvo at gmail.com
Wed Jun 29 03:32:02 MDT 2005
Firstly, I love nevow, brilliant design, really just plain brilliant.
Thanks in advance for any help with this problem.
# PROBLEM
The livepage/evil example failes with this error in the Firefox JS console
# ERROR
Error: nevow_clientToServerEvent is not defined
# SYSTEM
OS: Gentoo Linux
Firefox version: 1.0.4
Nevow revision: 1595
# EXAMPLE CODE
from nevow import rend, loaders, tags
from nevow.liveevil import handler
def greeter(client, nodeName):
client.alert("Greetings. You clicked the %s node." % nodeName)
# Any string arguments after the event handler function will be evaluated
# as JavaScript in the context of the web browser and results passed to the
# Python event handler
handler = handler(greeter, 'node.name')
class LivePage(rend.Page):
docFactory = loaders.stan(
tags.html[
tags.body[
tags.ol[
tags.li(onclick=handler, name="one")["One"],
tags.li(onclick=handler, name="two")["Two"],
tags.li(onclick=handler, name="three")["Three"]
]
]
])
Thanks
More information about the Twisted-web
mailing list