XMLHTTP TimeOut

  • Follow


Hello,

Is possible to determine the timeout of XMLHTTP Request?

My solicitations using the XMLHTTP they are giving error and
this because the page it is delaying a little more to send the result
to the XMLHTTP...

Thanks,
0
Reply Marcos 6/29/2005 9:55:55 AM

My pages is in PHP :(

Thanks.

Em Wed, 29 Jun 2005 13:14:29 -0000, Martin Honnen <mahotrash@yahoo.de>  
escreveu:

>
> Marcos wrote:
>
>> Is possible to determine the timeout of XMLHTTP Request?
>
> The client-side object (e.g. Msxml2.XMLHTTP) does not have a method to  
> set timeouts but the server side object (e.g. Msxml2.ServerXMLHTTP)  
> which can be used in ASP pages has a method:
> <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk/html/7e91f3de-d21c-404d-966a-95c148b22e98.asp>
0
Reply Marcos 6/29/2005 10:29:03 AM


Around of Six seconds, in local test.

If help, the code is:

function getcategories(xmlhttp)
{
	if(xmlhttp)
	{
	
	xmlhttp.open("GET", "MYPAGE",true);
		xmlhttp.onreadystatechange=function()
		{
			if(xmlhttp.readyState==4)
			{
				if(xmlhttp.status==200)  
{window.opener.document.getElementById('c_categories').value =  
xmlhttp.responseText;}
				if(xmlhttp.status==404) alert("Page not Found");
			}
		}
	xmlhttp.send(null);
	alert("Your Choise was stored");
	self.close(); // Close the window
}

I already change the  
window.opener.document.getElementById('c_categories').value =  
xmlhttp.responseText; to alert(xmlhttp.responseText) for test and the  
problem continues.

Thanks.
0
Reply Marcos 6/29/2005 12:30:17 PM

Marcos wrote:

> Is possible to determine the timeout of XMLHTTP Request?

The client-side object (e.g. Msxml2.XMLHTTP) does not have a method to 
set timeouts but the server side object (e.g. Msxml2.ServerXMLHTTP) 
which can be used in ASP pages has a method:
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk/html/7e91f3de-d21c-404d-966a-95c148b22e98.asp>

-- 

	Martin Honnen
	http://JavaScript.FAQTs.com/
0
Reply Martin 6/29/2005 1:14:29 PM

Marcos wrote:
> Is possible to determine the timeout of XMLHTTP Request?
> My solicitations using the XMLHTTP they are giving error and
> this because the page it is delaying a little more to send the result
> to the XMLHTTP...

A browser's timeout using XMLHttpRequest should be the same as its normal 
timeout period for any other request.

How long is your server taking to deliver the result?

-- 
Matt Kruse
http://www.JavascriptToolbox.com
http://www.AjaxToolbox.com


0
Reply Matt 6/29/2005 1:21:30 PM

Could you post an example URL?

Yes. I Can.

xmlhttp.open("GET",  
"apps.php?call=navcategory&maxlimit="+maxlimit+"&selected_cat="+selected+ "&xmlactive=true&finish=true",true);

I have more informations, the firefox detected one error:

Error: [Exception... "Component returned failure code: 0x80040111  
(NS_ERROR_NOT_AVAILABLE) [nsIXMLHttpRequest.status]"  nsresult:  
"0x80040111 (NS_ERROR_NOT_AVAILABLE)"  location: "JS frame ::  
http://200.138.105.166:45751/apps/js/category.js :: anonymous :: line  
133"  data: no]
Source File: http://200.138.105.166:45751/apps/js/category.js
Line: 133

Line 133:

if(xmlhttp.status==200)  
{window.opener.document.etElementById('c_categories').value =  
xmlhttp.responseText;}

If I get the address apps.php(etc..) and past in the browser the result is  
returned correctly...

Any Idea?

-- 

Thanks,

Marcos José Setim
________________________________________
Usando o M2 do Opera: http://www.opera.com/m2/
0
Reply Marcos 6/29/2005 5:00:47 PM

Marcos wrote:
> Around of Six seconds, in local test.

It times out in 6 seconds? Then it's surely not the browser timing out the 
request. Something else is going on.

> If help, the code is:

Could you post an example URL? The code is fine, but since there's probably 
something else going on, we'd need to see the whole page to know for sure.

-- 
Matt Kruse
http://www.JavascriptToolbox.com
http://www.AjaxToolbox.com


0
Reply Matt 6/29/2005 5:57:08 PM

Marcos wrote:
<snip>
> xmlhttp.send(null);
> alert("Your Choise was stored");
> self.close(); // Close the window
<snip>

It is difficult to see closing the window from which you are making an
xml http request just after sending the request as a good idea.

Richard.


0
Reply Richard 6/29/2005 9:43:35 PM

Marcos wrote:

> Could you post an example URL?
> 
> Yes. I Can.
> 
> xmlhttp.open("GET",
> "apps.php?call=navcategory&maxlimit="+maxlimit+"&selected_cat="+selected+
> "&xmlactive=true&finish=true",true);

1. <http://en.wikipedia.org/wiki/URL>

2. 

  xmlhttp.open(
    "GET",
    [
      "apps.php?call=navcategory&maxlimit=", maxlimit, 
      "&selected_cat=", encodeURIComponent(selected),
      "&xmlactive=true&finish=true"
    ].join(""),
    true);
 
> I have more informations, the firefox detected one error:

(more _information_)
  
> Error: [Exception... "Component returned failure code: 0x80040111
> (NS_ERROR_NOT_AVAILABLE) [nsIXMLHttpRequest.status]"  nsresult:
> "0x80040111 (NS_ERROR_NOT_AVAILABLE)"  location: "JS frame ::
> http://200.138.105.166:45751/apps/js/category.js :: anonymous :: line
> 133"  data: no]
> Source File: http://200.138.105.166:45751/apps/js/category.js
> Line: 133
> 
> Line 133:
> 
> if(xmlhttp.status==200)

From the exception above, it appears that there is no `status' property
available here.  Could be a cross-domain issue as you access the machine
with the IP address 200.138.195.166 instead of the current domain or
one of its subdomains.

> {window.opener.document.etElementById('c_categories').value =
                         ^^[1]

If `c_categories' is the ID of a form control, you should use

  window.opener.document.forms[...].elements['c_categories'].value = ...;

If you access this object repeatedly, you should assign a reference
to a variable and use the variable instead to save lookups.

[1] Typo?


PointedEars
0
Reply Thomas 7/16/2005 11:17:59 AM

8 Replies
380 Views

(page loaded in 0.131 seconds)

Similiar Articles:






7/20/2012 6:36:41 AM


Reply: