473,385 Members | 1,927 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 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 2217
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: dougwig | last post by:
I'm trying to handle the scenario where a user's session times out and and their ajax request triggers a redirection by the webserver (302 error?). I'm using Prototype 1.4 and the my works great...
1
by: geevaa | last post by:
http://www.phpbuilder.com/columns/kassemi20050606.php3 XMLHttpRequest and AJAX for PHP programmers James Kassemi Introduction: Although the concept isn't entirely new, XMLHttpRequest...
2
by: Zeba | last post by:
Hi guys! I'm new to JS / Ajax; I've been trying to do an Ajax call to my Webservice ( I'm using C# for code-behind). I'm not using any of the libraries available. I am sending my CustID to the...
6
by: =?Utf-8?B?U2hhd24gU2VzbmE=?= | last post by:
Greetings! I was researching AJAX to provide a solution to displaying status messages while a long process executed. I found several examples online and was able to use their code to get a quick...
2
by: shivendravikramsingh | last post by:
hi friends, i m using a ajax function for retrieving some values from a database table,and display the values in required field,my prob is that the ajax function i m using is working f9 once,but if...
16
by: phpmel | last post by:
Hi again, I tried this Ajax database thing for the first time and it is not working. Here is the code this is testAjax.php <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
18
omerbutt
by: omerbutt | last post by:
AJAX PROB WITH MULTIPLE RECORDS helo iam having problem in ma code will any body look out an help, i am trying t add sale record in the database and the checkthe quantity of the part slod and...
4
RamananKalirajan
by: RamananKalirajan | last post by:
Hi All, I am using Ajax inorder to retrieve a data from the db which is an xml and i am parsing the responseText into an xml. the code what i had tried is working well with IE, but the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
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 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.