JSONP web service with python

后端 未结 4 1782
迷失自我
迷失自我 2020-12-16 04:26

I\'m writing an AJAX function that requests data from my JSON Python webservice. My AJAX request looks like:

  url = \"http://localhost:8001/blah\"
  $.aja         


        
4条回答
  •  再見小時候
    2020-12-16 04:41

    Zack got it. My javascript was correct. I changed my python return statement to the following:

    callback = request.args.get('callback')
    return '{0}({1})'.format(callback, {'a':1, 'b':2})
    

提交回复
热议问题