Skip to content Skip to sidebar Skip to footer

Error : : Jquery Was Not Called

Here is my ajax call. $.ajax({ type: 'GET', url: 'http://example.com/v1/search?keyword=r', dataType: 'jsonp', crossDomain: true, success: function (responseStr

Solution 1:

That suggests either a network error or an end point that doesn't return a JSONP response.

(I'm guessing the DNS lookup failure I get when testing it is because that isn't your real URL (please use example.com for example URLs, that is what it is there for) if not, then that is your problem).

Solution 2:

It's an incorrect JSONP Response. The server needs to process the callback=nameOfCallbackFunction argument of the GET Request and serve it as a function wrapper.

The proper response then should look like this:

nameOfCallbackFunction({"yourjson": "here"});

Solution 3:

I know this is an old thread but have struggled to get a cross domain ajax example working. I read much about using dataType: jsonp and support.cors = true but got a 200 - success but a parseerror.

I then read in this thread about using one or the other. I then changed the dataType: to json and left the support.cors = true and it worked. Finally . . .

This may help someone else who encounters the same issue.

Solution 4:

The reason why you have the error JQueryXXXX is because there is an error in the url you are calling, you need to introduce "?callback=?", so looks like:

"http://example.com/v1/search?callback=?keyword=r"

Also If you call a .php remember:

header('Content-Type: application/json; charset=utf8');

Post a Comment for "Error : : Jquery Was Not Called"