How to get 406 Error (not acceptable) in jquery

馋奶兔 提交于 2019-12-02 09:42:08
Salman A

Judging by the jsoncallback=? parameter and the response jQuery191...780({...}), it seems like jQuery is generating a JSONP request. JSONP requests are not subject to the same origin policy restrictions but they do have the following limitation as described here:

Note: This [error] handler is not called for cross-domain script and cross-domain JSONP requests.

The solution:

  1. Create a pure JSON request if the server allows cross-domain requests
  2. Look at answers for these questions:
  3. Use jquery-jsonp -- it does not give you the HTTP error code
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!