AJAX .responseText not working - Please Help!

S

Snt

Hi!

I am trying to get AJAX working on multiple browsers and am having a
problem with Firefox.

I have the following code:

function handleState3(){
switch(http.readyState) {
case 0: // Uninitialized

break;
case 1: // Loading

break;
case 2: // Loaded

break;
case 3: // Interactive

break;
case 4: // Finished
var response = http.responseText;
if (!response) {

} else {
alert('No response received from Notify Server.');
}
break;
default:
alert("ERROR: unknown HTTP state: "+http.readyState);
break;
}
}



AND:

function global_subscribe(email) {
if (email!="" && email) {
http.open("post", "notify.php");
http.setRequestHeader("Content-Type",
"application/x-www-form-urlencoded");
http.onreadystatechange = handleState3;
http.send("type=global&email="+email);
}
}


You can test this script on www.dwergpapegaai.com by clicking on the
Email Icon next to the search box in the green area just below the
message edit area.

It seems that responseText is not working in Firefox!

Please Help!

Best Regards,
Snt
 
S

Snt

I already added Match.random();

http.send("type=global&email="+email+"&r="+Math.random());

Doesn't work. Strangely, when I query the url without Math.random() and
query it again it does work....
 
M

Martin Honnen

Snt wrote:

I am trying to get AJAX working on multiple browsers and am having a
problem with Firefox.
You can test this script on www.dwergpapegaai.com by clicking on the
Email Icon next to the search box in the green area just below the
message edit area.

Loading that page with Firefox 1.5 already shows script errors

Error: unterminated string literal
Source File: http://www.dwergpapegaai.com/functions.js
Line: 156, Column: 20
Source Code:
oXml.open('POST', 'http://www.dwergpapegaai.com/search.php", true);

Clicking that icon gives another script error

Error: global_subscribe_query is not defined
Source File: http://www.dwergpapegaai.com/
Line: 1

so I suggest you use the Firefox JavaScript console and fix your errors.
 
S

Snt

Hi!

Thank you for your response.

I was working on the code so that is why the error was there when you
checked it.

Right now it is working again so you could check it again if you like.

Best Regards,
Snt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top