I have a function in Jquery, that try get html from an page:
$.ajax({
type:'GET',
url: 'http://www.google.com',
success: function( data ) {
alert( data );
}
});
why does not works? in firebug I see the communication headers.
I have a function in Jquery, that try get html from an page:
$.ajax({
type:'GET',
url: 'http://www.google.com',
success: function( data ) {
alert( data );
}
});
why does not works? in firebug I see the communication headers.
Well, for security reasons, Javascript don't allow a page to load a page from external domains. These security reasons are to prevent users from form hijacking, xss attacks etc. If you still want to load external pages, you can use iframes, else you will need an openId kind of thing in your backend.
Cross domain $.ajax is not permitted due to security violation. The only cross domain call that you can do in jQuery is JSONP request.
Please read my answer to this question: JavaScript: How do I create JSONP?