After some experimenting, I was able to get JSONP working, but I'm
wondering if there is a cleaner way of doing it than what I came up
with:
In my GET() method, I grab the name of the callback function:
self.cbfn = form.value['callback']
then when I return the data to the server, I have:
web.header('Content-Type', 'application/javascript')
return "%s(%s)" % (self.cbfn, json.dumps(ret_data))
Is this the "right" way to do it? It's working OK, I was just
surprised not to find any support in the JSON module.
Philip
--
You received this message because you are subscribed to the Google Groups
"web.py" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/webpy?hl=en.