I'm writing a Chrome extension which performs a simple ajax call (based on this example from the docs):
$.ajax({
type: "GET",
url: "http://www.flags.99k.org/getFlags.php"
}).done(function(response) {
alert("SUCCESS: " + response);
}).fail(function(response) {
alert("FAILURE: " + response);
});
The request always fails, because the alert shows: FAILURE: [object Object]
.
The URL is valid: When I put http://www.flags.99k.org/getFlags.php in my address bar, I get this:
[{"UID": "1", "Message": "Hello"}, {"UID": "2", "Message": "World"}, {"UID": "3", "Message": "Hello World"}]
Here is my manifest.json for the extension.
{
"name": "Hello World",
"version": "1.0",
"description": "The first extension that I made.",
"browser_action": {
"default_icon": "icon.png",
"default_popup": "popup.html"
},
"permissions": [
"http://www.flags.99k.org/"
]
}
I use Chromium 17.0.963.79 (Developer Build 125985 Linux) Ubuntu 11.10.