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 using JSONP technique.
But, while calling, its adding callback
and _(timestamp)
parameters with service-URLs, automatically.
The timestamp parameter is removed- by adding cache : true
. But cant remove the callback parameter.
here is my AJAX calling code-
$.ajax({
type: 'GET',
url : "http://test.com/test/services/getFollowMeHistory/1/1/50",
dataType:'jsonp',
cache : true,
crossDomain : true,
//jsonpCallback : false,
error : function(XMLHttpRequest, textStatus, errorThrown) {
alert("Error occured while loading Loads."+textStatus);
}
});
});
Its calling the URL as- http://test.com/test/services/getFollowMeHistory/1/1/50?callback=false
and am getting 404 from service side.
My service is returning data as callbackMethod( {..JSON RESPONSE...} ). So, it will automatically call the function callbackMethod(data)
in my script. i dont need that callback parameter in my URL.
Just need to remove the ?callback=...
part from URL
Plz help.
If you set cacheing to true
ie will cache the
request response, and all subsequent JSONP calls will not return new
data.
Without the callback JSONP is unusable, because there is no way to read the response. The callback is the whole point of JSONP.
If you are using a custom callback Try this, but a custom callback is not the same as removing the callback:
jsonpCallback : "callbackMethod"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With