following my code:
$('#btnOK').click(function(e){
e.preventDefault();
$form = $('#testForm');
dataString = $form.serialize();
$.ajax({
type: "POST",
url: 'https://abc.com/login',
data: dataString,
dataType: 'xml',
success: function( returnData ) {
alert(returnData);
}
});
});
My Code fails to make ajax request to http://abc.com/login page and doesn’t gives out result. What’s the mistake here?
Is it due to cross domain likely:
my domain: http://xyz.com
login domain: http://abc.com/login
unless your
abc.comdomain is configured to deal with cross-origin policy, you won’t be able to make a cross-domain ajax callA solution is to redirect your ajax call to a server side proxy under
xyz.comdomain who send your data and get the response fromabc.com(e.g. usingCURL).or if you’re in control of
abc.comdomain you could send proper headers (Access-Control-*) to allow crossdomain calls