Neither:
var response = $.ajax({
type: "GET",
url: "http://www.google.de",
async: false,
success : function() {
alert (this);
}
});
Nor:
var response2 = $.get("http://www.google.de", function(data) {
alert("Data Loaded: " + data);
});
give me an object. How do I get access to the responseText
?
You simply must rewrite it like that:
Since jQuery AJAX requests fail if they are cross-domain, you can use cURL (in PHP) to set up a proxy server.
Suppose a PHP file responder.php has these contents:
Your AJAX request should be to this responder.php file so that it executes the cross-domain request.
try this