I should request the data as jsonp
to perform cross domain request. But actual result returned is json like {"q":"iphone","r":["iphone 5","iphone","обмен на iphone","iphone 4","iphone 5s"]}
.
I've tried to use multiple values in dataType like:
$.ajax({
url: url,
type: 'GET',
dataType: 'jsonp json',
jsonp: false,
...
but it returns parsererror
(the same as just with jsonp
).
I also tried to do the call with and without callback
:
$.ajax({
url: url,
type: 'GET',
dataType: 'jsonp json',
cache: true,
jsonpCallback: 'callbackFunctionName',
jsonp: 'callback',
What can I do to process such result correctly?
Upd. I tried to use script
instead of jsonp
, it works better - success
/done
function is called (instead of error
/fail
), but I can not get response text - data passed to success()
is undefined
as well as jqXHR.responseText
passed to complete()
is empty.