Reputation: 61729
The alert box will display nothing, and not return any data from any URL when it should be showing the google page! Any ideas? I'm using POST because I'm trying to get it to send querystring data as well.
$.ajax({
type: "POST",
url: "http://www.google.com",
success: function(msg) {
alert("Data Saved: " + msg);
}
});
Upvotes: 1
Views: 796
Reputation: 8981
You can do this only if you own google.com which I believe is at least unlikely:) (cross domain issues)
To overcome this you can make post to your server and let server connect to google.com, then you can respond to the user with data retrieved from google.com.
Upvotes: 0
Reputation: 7564
yea TOm,
You are doing cross-domain scripting.
change the URL to a file which is in your own Domain.
$.ajax({
type: "POST",
url: "anyfileinYourDomain.xxx",
success: function(msg) {
alert("Data Saved: " + msg);
}
});
Upvotes: 3