I have a webpage where the user enters an email address and hits the tab key to activate a function onChange and I use Ajax to read a MySQL database and then displays a message if that email address is already on the database or not. It works fine in IE8, but in Safari it doesn't work. Here is my function to check for which XML Http Object:
And here is how I call it:
I am not getting the alert, it just tabs to the next field. What am I doing wrong. I need this to work with all browsers.
Thanks,
Fred
Code:
function GetXmlHttpObject(){
if (window.XMLHttpRequest)
{
// code for IE7+, Firefox, Chrome, Opera, Safari
return new XMLHttpRequest();
}
if (window.ActiveXObject)
{
// code for IE6, IE5
return new ActiveXObject("Microsoft.XMLHTTP");
}
return null;
}
Code:
var xxmlHttp;
xxmlHttp=GetXmlHttpObject();
if (xxmlHttp==null){
alert ("Browser does not support HTTP Request");
return;
}
Thanks,
Fred
Comment