Reputation: 91
I am making cross domain jQuery get()
and it failing with a "405 not allowed" error.
My Greasemonkey script is something like this:
// ==UserScript==
// @include http://www.foobar.com/*
// ==/UserScript==
var query = "www.foobar.com";
$.get(
url,
function(response){
alert(response);
},
"xml"
);
Any pointers will be highly appreciated.
Upvotes: 2
Views: 5137
Reputation: 93473
get()
and other jQuery AJAX functions do not work cross-domain, by design. (It was/would-be a huge security hole, if they did.)
Use GM_xmlhttpRequest() instead, it does allow cross-domain AJAX.
Upvotes: 4