473,491 Members | 2,583 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Ajax call returning prematurily

Hi All,

Browser - IE 6.0
Server - Jboss 4.2.1 (Tomcat 6.0)

We are making call to the server using ajax to get some data. In a
worst case scenario the backend thread may take as long as 1 minute to
return. But sometimes what happens is I get the callback prematurily
saying that data is available. In other words,
onreadystatechange=function() gets triggered.

I debugged from the server side to see if the servlet (processing the
original request) is calling back and I don't see that happening.

I tried to use "new ActiveXObject('Msxml2.XMLHTTP.5.0').setTimeouts()"
to increase the timeout but it seems that call is not valid for the
client object.

Is there a way I can increase the time out.

Thanks
Rajesh
Mar 19 '08 #1
4 1329
Simon_21 wrote:
We are making call to the server using ajax to get some data. In a
worst case scenario the backend thread may take as long as 1 minute to
return. But sometimes what happens is I get the callback prematurily
saying that data is available. In other words,
onreadystatechange=function() gets triggered.
Well check the readyState property for value 4 to ensure you process the
complete response.
--

Martin Honnen
http://JavaScript.FAQTs.com/
Mar 19 '08 #2
On Mar 19, 11:23*am, Martin Honnen <mahotr...@yahoo.dewrote:
Simon_21 wrote:
We are making call to the server using ajax to get some data. In a
worst case scenario the backend thread may take as long as 1 minute to
return. But sometimes what happens is I get the callback prematurily
saying that data is available. In other words,
onreadystatechange=function() gets triggered.

Well check the readyState property for value 4 to ensure you process the
complete response.

--

* * * * Martin Honnen
* * * *http://JavaScript.FAQTs.com/
Thanks for the reply.
I did check that unfortunately in both case it is 4. I also did a dump
of the getResponseHeaders() to see if there is a difference between
the legitimate repsonse and invalid one and unfortunately no luck.

Mar 19 '08 #3
Simon_21 wrote:
I did check that unfortunately in both case it is 4. I also did a dump
of the getResponseHeaders() to see if there is a difference between
the legitimate repsonse and invalid one and unfortunately no luck.
Does that happen with different browsers? Or just one particular browser?

--

Martin Honnen
http://JavaScript.FAQTs.com/
Mar 20 '08 #4
On Mar 20, 8:52*am, Martin Honnen <mahotr...@yahoo.dewrote:
Simon_21 wrote:
[....]>
Does that happen with different browsers? Or just one particular browser?
It only happens with IE (actually 6.0 (tried with different
subversions and service packs), didn't try 7.0 as that is not a viable
option).

On Firefox, I was not able to reproduce this. If that is the case was
planning to use 'Firebug' to see what was actually going on. With IE
MS Script Editor doesn't seem to help much.

Thanks
Rajesh
>
--

* * * * Martin Honnen
* * * *http://JavaScript.FAQTs.com/
Mar 20 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
1406
by: NH | last post by:
Hi, I have been toying around with this for a day now. Has anyone else tried it? Two questions: 1: How do you pass a paramater to the server side event, e.g. if you wanted to pass a selected...
2
1740
by: dondraper | last post by:
I have an application that uses a popular but simple set of JavaScript routines that implement an AJAX call used to populate a drop-down. It works for thousands of user but I have one customer...
5
1750
by: darrel | last post by:
I've been playing with prototype.js and scriptaculous to create some nice drag-and-drop interaction on my applications GUI. That's working well. Now I want to take the next step and start passing...
7
1793
by: BeeRich | last post by:
Hi folks. I built an ajax.updater reply in a website on a Mac, and she works fine. It's a simple reply, the html supplied is correct, and I also supply the target DIV as well. Just wondering...
2
1379
by: Ralph | last post by:
I was playing a little bit with a lot of ajax frameworks. I have even wrote one small by myself. But one thing still drives me crazy: Whenever I'm doing an ajax call I need to specify handler to...
2
1646
by: majidtou | last post by:
Hi , We have an HTML page which is using AJAX. We make an AJAX call which retrieves a table with mutiple rows. We need to extend this functionality. In the table, we want to put a button on each...
2
1396
by: KDawg44 | last post by:
Hi, I am calling a series of PHP scripts from AJAX calls and would like to return XML. So I have a PHP Script that does this: function foo(param) { // do some stuff, query the db, do some...
6
9789
by: KDawg44 | last post by:
Hi, My responseXML is always null on my AJAX call. When I browse directly to the PHP script I am calling, the XML file shows up just fine. I have read that if a returned XML file is not...
1
4579
by: javediq143 | last post by:
Hi All, This is my first post in this forum. I'm developing a CMS for my latest website. This CMS is also in PhP & MySQL. I'm done with the ADD section where the Admin can INSERT new records in...
0
7112
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,...
0
6974
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
7146
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,...
0
7356
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...
0
5448
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4878
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...
0
4573
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...
0
1389
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
277
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...

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.