AJAX JSONP call automatically adding callback parameter. How to remove that?

前端 未结 2 1588
梦如初夏
梦如初夏 2021-02-14 05:23

I have few Services- with clean-URLs

and while calling each service, the URL pattern is being checked.

Now am calling those URLs via AJAX from another server u

2条回答
  •  太阳男子
    2021-02-14 05:49

    1. If you set cacheing to true ie will cache the request response, and all subsequent JSONP calls will not return new data.

    2. Without the callback JSONP is unusable, because there is no way to read the response. The callback is the whole point of JSONP.

    3. Your server must be set up to handle a JSONP request. The url you send will not effect the client side. So your problem must be on the server-side. Which is where you should handle it. Making this not a jQuery problem.

    If you are using a custom callback Try this, but a custom callback is not the same as removing the callback:

     jsonpCallback : "callbackMethod"
    

提交回复
热议问题