I've tried ?callback=?, got the same error, looks like the pyramid didn't match the request to the view callable
On Sun, Sep 8, 2013 at 11:47 PM, Gael Pasgrimaud <[email protected]> wrote: > Hi, > > On Sun, Sep 08, 2013 at 11:28:49PM +0800, george hu wrote: > > Hello everyone, I can't figure out how to make jsonp request work, my > view > > callable is like this: > > > > @view_config(route_name="get_server_status", renderer='jsonp') > > def get_server_status(request): > > return {"george":"hello"} > > > > and here is the lines in __init__.py: > > > > from pyramid.config import Configurator > > from pyramid.renderers import JSONP > > > > def main(global_config, **settings): > > """ This function returns a Pyramid WSGI application. > > """ > > config = Configurator(settings=settings) > > config.add_static_view('static', 'static', cache_max_age=3600) > > config.add_route('home','/') > > > > config.add_renderer('jsonp', JSONP(param_name='callback')) > > config.add_route('get_server_status', '/get_server_status*') > > > > and my javascript: > > > > <script> > > $(function() { > > var serverAPI = "http://127.0.0.1:3456/get_server_status&callback= > ?"; > > Should be: > > var serverAPI = "http://127.0.0.1:3456/get_server_status?callback=?"; > > -- > You received this message because you are subscribed to the Google Groups > "pylons-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/pylons-discuss. > For more options, visit https://groups.google.com/groups/opt_out. > -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/pylons-discuss. For more options, visit https://groups.google.com/groups/opt_out.
