472,143 Members | 1,802 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,143 software developers and data experts.

AJAX .responseText not working - Please Help!

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

Aug 28 '06 #1
3 2076
Snt
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....

Aug 28 '06 #2


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.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Aug 28 '06 #3
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
Martin Honnen wrote:
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.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Aug 28 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by geevaa | last post: by
2 posts views Thread by Zeba | last post: by
6 posts views Thread by =?Utf-8?B?U2hhd24gU2VzbmE=?= | last post: by
reply views Thread by Saiars | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.