timeout property

Gets or sets the time-out value.

 

Syntax

HRESULT value = object.put_timeout( v);HRESULT value = object.get_timeout(* p);

Property values

Type: long

the number of milliseconds that the browser is to wait for a server response. Default value is 0.

Remarks

Note   The IHTMLXMLHttpRequest2::timeout property has a default value of 0.

 

If the time-out period expires, the IHTMLXMLHttpRequest::responseText property will be NULL.

You should set a time-out value that is slightly longer than the expected response time of the request.

The IHTMLXMLHttpRequest2::timeout property may be set only in the time interval between a call to the IHTMLXMLHttpRequest::open method and the first call to the IHTMLXMLHttpRequest::send method.

If you set an XMLHttpRequest time-out value that is larger than the network stack's time-out value, the network stack will time out first and the ontimeout event will not be raised.

Examples

The following example sets the IHTMLXMLHttpRequest2::timeout property.

var xhr;
xhr = new XMLHttpRequest();
xhr.open("GET", url, true);
xhr.timeout = 10000;
xhr.ontimeout = timeoutFired;
xhr.send(null);

See also

Reference

IHTMLXMLHttpRequest2

XMLHttpRequest

IHTMLXDomainRequest

XDomainRequest