0

How to return jsonp with cherrypy? I am currently using the following to return json:

class Root(object):
   @cherrypy.expose
   @tools.json_out
   def index(self):
      return {'key':'value'}

Is there some annotation for jsonp?

Rolando
  • 58,640
  • 98
  • 266
  • 407

1 Answers1

0

Check out this implementation...

jsonp

Hope this helps,

Andrew

Andrew Kloos
  • 4,189
  • 4
  • 28
  • 36
  • That example appears to just return 'Works' how does it actually return jsonp? – Rolando Feb 21 '13 at 18:28
  • the tag: @jsonp runs the jsonp handler. Then Jquery handles the jsonp: $.ajax({url:"localhost:8080/", data:{'key':'value'}, dataType:"jsonp", success:onMyMethodComplete}); – Andrew Kloos Feb 23 '13 at 02:08
  • oh - this link has great jsonp info... http://stackoverflow.com/questions/2067472/what-is-jsonp-all-about – Andrew Kloos Feb 23 '13 at 02:16