I m using AJAX to get a PHP file from another domain name.
In fact the domain where I have installed the jQuery function does not support the PHP send mail function, so I had to use an external web server to send the emails out.
This is what I have done with jQuery:
if(hasError == false) {
var referenteVal = $("#referente").val();
var cittaVal = $("#citta").val();
var provinciaVal = $("#provincia").val();
var offertaVal = $("#offerta").val();
$.get("http://externaldomain.com/send_mail.php",
{ nome: emailToVal, email: emailFromVal, telefono: telefonoVal, referente: referenteVal, citta: cittaVal, provincia: provinciaVal, commento: messaggioVal, offerta: offertaVal},
function(data){
if(data=='errore') {
alert('ERRORE'); }
else{
alert('Grazie! Messaggio inviato. La ricontatteremo il prima possibile.');
$.fancybox.close();
}
}
);
Now this code works just fine in every browser but NOT in IE.
In fact in IE I get an Access Denied Error for my jQuery code!!
How do I fix it?
What is the problem?
Why IE is not allowing me to do a GET request to a different domain name??
Thanks!
If you want to make call to different domains you should use $.ajax() and set
crossDomaintotrueanddataTypetojsonpi think.