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: -
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;
-
}
-
And here is how I call it: -
var xxmlHttp;
-
-
xxmlHttp=GetXmlHttpObject();
-
if (xxmlHttp==null){
-
alert ("Browser does not support HTTP Request");
-
return;
-
}
-
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
6 1463 @HawkMan24
OK, I put alerts in my function GetxmlHttpObject and it displays the alert saying that it got the xml requets for Safari. So why doesn't it display the message. I am sending the message to a div id tag that I have below the input textbox for the email address. - <div id="output1" style="color: blue;"></div>
and here is the code to check the email address for duplicate. -
function omrCheckEmail(){
-
var divid = 'output1';
-
var loadingmessage = 'Processing...';
-
var xxmlHttp;
-
-
xxmlHttp=GetXmlHttpObject();
-
if (xxmlHttp==null){
-
alert ("Browser does not support HTTP Request");
-
return;
-
}
-
xxmlHttp.onreadystatechange = function(){
-
if (xxmlHttp.readyState > 0 && xxmlHttp.readyState < 4){
-
document.getElementById(divid).innerHTML=loadingme ssage;
-
}
-
if (xxmlHttp.readyState == 4) {
-
emBoolean = xxmlHttp.responseText;
-
if (emBoolean == 'true') {
-
document.getElementById(divid).innerHTML="THIS EMAIL HAS REGISTERED!";
-
}
-
else {
-
document.getElementById(divid).innerHTML="THIS EMAIL HAS NOT REGESTERED!";
-
}
-
}
-
}
-
-
var queryString = '&email=' + (document.getElementById('custom').value);
-
-
xxmlHttp.open("POST", "omrCheckEmail.php", true);
-
xxmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
-
xxmlHttp.setRequestHeader("Content-length", queryString.length);
-
xxmlHttp.setRequestHeader("Connection", "close");
-
xxmlHttp.send(queryString);
-
}
-
And my omrCheckEmail.php returns either "true" or "false" accordingly.
Can anyone help me with this problem?
Does it work in Firefox?... Have you seen what's happening in Firebug or error console?
@hsriat
I have only tested it on IE and Safari. It works fine on IE but not on Safari. I don't have Firefox on my computer.
Anybody have any ideas or suggestions? I really need to have this working in all browsers before I can put it out there. I am doing this as a volunteer for a national organization. Thanks!
@HawkMan24
Figured it out, thanks for nothing folks! LOL
Sign in to post your reply or Sign up for a free account.
Similar topics
by: DU |
last post by:
According to a recent post, it seems that Konqueror 3.1+ and Safari 1.1
support CSS3 opacity style property under a proprietary name:
"Support for the CSS3 opacity (using -khtml-opacity)...
|
by: Lutz Ißler |
last post by:
Hi all!
I dymically replace the child nodes of a DIV element by image nodes. In
IE and Firefox this works properly. In Safari it works properly, too -
but only if the site is called locally, eg....
|
by: jdlwright |
last post by:
Hi,
I have a big script that doesn't work in Safari 1.3, but does work in
FF, and IE. I've given up going to my local Uni. to use their Macs
(they've prevented the Debug menu from appearing...
|
by: Simon Wigzell |
last post by:
document...focus() will scroll the form to move the
specified text field into view on everything I have tried it with except
Safari on the MAC. The form doesn't move. Any work around? Thanks.
|
by: effendi |
last post by:
I wrote the following function and tested it in MSIE, Firefox and Mac
Safari, Works in all but the Safari. What can I do to rectify this?
function processBackground(){ for (n=1;n<11;n++)
{
...
|
by: Edward |
last post by:
Hi All,
I feel frustrated with one of my Customers who wants me to ensure that a
dotnet web site I am building for them must be compatible to Apple's Safari
browser!
Safari is buggy and it...
|
by: Tom |
last post by:
I have an oo-type javascript program running perfectly on IE 6.0+, FF
1.5+, and Opera 7+ on Windows 98+, Linux (RH 9, FC 6), and Mac OS X.
4. As usual, the Safari browser is not working correctly,...
|
by: Stevo |
last post by:
I've been using the unload event for a long time. I have this code,
which I've abstracted and made into a stripped down simple test case
below, and it works fine on the major browsers (IE5+,...
|
by: David Stone |
last post by:
Run into something recently that has left me a little puzzled.
According to the examples in section 13.6.1 of html 4.01...
<http://www.w3.org/TR/html401/struct/objects.html#h-13.6.1.1>
I...
|
by: Brad |
last post by:
I have an aspx page that is sending pdf files to client browsers: it uses a filestream to read the pdf file and
response.binarywrite to send content to the browser. This has worked great for years...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| | |