Connecting Tech Pros Worldwide Forums | Help | Site Map

AJAX .responseText not working - Please Help!

Snt
Guest
 
Posts: n/a
#1: Aug 28 '06
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


Snt
Guest
 
Posts: n/a
#2: Aug 28 '06

re: AJAX .responseText not working - Please Help!


I already added Match.random();

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

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

Martin Honnen
Guest
 
Posts: n/a
#3: Aug 28 '06

re: AJAX .responseText not working - Please Help!




Snt wrote:

Quote:
I am trying to get AJAX working on multiple browsers and am having a
problem with Firefox.
Quote:
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.





--

Martin Honnen
http://JavaScript.FAQTs.com/
Snt
Guest
 
Posts: n/a
#4: Aug 28 '06

re: AJAX .responseText not working - Please Help!


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


Martin Honnen wrote:
Quote:
Snt wrote:
>
>
Quote:
I am trying to get AJAX working on multiple browsers and am having a
problem with Firefox.
>
Quote:
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.
>
>
>
>
>
--
>
Martin Honnen
http://JavaScript.FAQTs.com/
Closed Thread