Whenever I do a JSONP call through jquery to any page I set up (either locally or on my server) all I get is the silent treatment. Firebug reports 200 OK and the response looks ok. I setup alerts boxes to popup on success or failure but neither appears. It doesn't seem to matter what url I use, nothing pops up.
BUT if I use the twitter json page then I the success alert box appears as expected so there is obviously something wrong with my response but I don't know what.
As an experiment I copied the twitter json response and uploaded it to my booroo.com domain. It should be identical, but still nothing. I set the headers on the response page to "application/json" and utf-8 but still nothing.
Please help, I've spent all day on this now and I don't know what else to try.
$.ajax({
dataType: 'jsonp',
// url: 'http://booroo.com/json.asp?callback=?',
url: 'http://twitter.com/users/usejquery.json?callback=?',
success: function () {
alert("Success");
},
error: function(x,y,z) {
alert("error"+x.responseText);
}
});
The response json.asp file contains the following classic ASP headers and then the json response copied from twitter (i've tried others without any success either.)
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%
Response.Expires = 0
Response.Expiresabsolute = Now() - 1
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
Response.CacheControl = "no-cache"
response.ContentType="application/json"
Response.CodePage = 65001
Response.CharSet = "UTF-8"
%>({"test_param":12345});