By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,605 Members | 2,147 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,605 IT Pros & Developers. It's quick & easy.

AJAX .responseText not working - Please Help!

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a


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

P: n/a
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.