I've look at all the cross-domain ajax questions, and still cannot figure out what is wrong with my JSONP request. All I am trying to do is get the contents of an external page, cross domain using JSONP. Unfortunately, firefox still gives this:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://stackoverflow.com/?_=1415036764663. This can be fixed by moving the resource to the same domain or enabling CORS.
Code:
var url = "http://stackoverflow.com";
$.ajax({
url: url,
type: "GET",
datatype: "jsonp", //allows cross-domain ajax without cors (GET only)
async: true,
cache: false,
timeout: 15000,
success: function(html) {
console.log(html);
}
});
stackoverflow.comdoesn't support JSONP. If you want data from StackOverflow, you need to use the API: api.stackexchange.com/docs