JSONP requires the cooperation of the server to succeed. You cannot pull random pages using JSONP and expect them to succeed; the server needs to know:
- It needs to formulate a JSONP response, rather than a JSON response.
- It needs to know the name of the function to wrap the response around.
If you're unsure on why the server needs to know these, or what the differences are between JSON and JSONP, you should read up on them; or the whole thing will make no sense. For starters, check out Can anyone explain what JSONP is, in layman terms? and http://en.wikipedia.org/wiki/JSONP.
After understanding this a little more, you'll probably find the server is returning
{ "key": 1, "bar": "foo" }
(which is valid JSON), rather than:
someCallback({ "key": 1, "bar": "foo" })
which is a JSONP response.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…