473,806 Members | 2,284 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.rea dyState) {
case 0: // Uninitialized

break;
case 1: // Loading

break;
case 2: // Loaded

break;
case 3: // Interactive

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

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

AND:

function global_subscrib e(email) {
if (email!="" && email) {
http.open("post ", "notify.php ");
http.setRequest Header("Content-Type",
"applicatio n/x-www-form-urlencoded");
http.onreadysta techange = 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 2244
Snt
I already added Match.random();

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

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.dwergpapega ai.com/search.php", true);

Clicking that icon gives another script error

Error: global_subscrib e_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.dwergpapega ai.com/search.php", true);

Clicking that icon gives another script error

Error: global_subscrib e_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
20092
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 with Firefox,but with IE6 the onFailure never gets called and the request never completes. My code: var ajaxReq = new Ajax.Request( url, {method: 'post', parameters:
1
4036
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 technology is implemented on more sites now than ever. Compatibility is no longer an issue (IE, Mozilla and Opera all support it), and the benefits to using it are amazing. There are too many PHP programmers avoiding any
2
5226
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 webservice and the webservice returns a Dataset that contains various customer details taken from database. I have tested that the Webservice itself works. But my ajax call is not working. My ajax call is something like :
6
5177
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 application working. However, when attempting to implement the solution, the AJAX calls weren't updating the screen like the examples were and seemed not to fire until after the long running process had completed. I found the only real...
2
3174
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 i change something in php file using in ajax function.it not refreshed,means its shows the previous result it not get updated.i can't understand whats the prob.this is the code i m using: <? include("config.inc.php"); //error_reporting(0); ...
16
1833
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" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head>
18
1983
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 decrement it to the current quantity for example if tehre is a part woth part no 10023 and its quantity in show room is 20 and total quantity is 25 then if there is a sale of 2 parts then i have to add the sale and decrement the current quantity in the...
4
2539
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 same makes a lot of trouble in mozilla any help would be greatful the following is the code if (httpRequest.readyState == 4) { if(httpRequest.status == 200) { var pricingSummaryXML = httpRequest.responseText;
0
9718
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10617
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10364
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10370
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10109
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7649
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6876
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
3849
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.