Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

burst.io.AbstractURIRequest Class Reference

Inheritance diagram for burst.io.AbstractURIRequest:

burst.io.IframeURIRequest burst.io.XmlHttpURIRequest List of all members.

Detailed Description

Abstract base class for fetching text content or an (XML) Document object given a URI.

Generally, a programmer need not use this directly, because the bu_Runtime object has convenience functions such as readEval , getTextAsync , getDocumentAsync . If you want to get an instance of this abstract class that is supported by the current environment, us bu_Runtime.getURIRequest .

To load and eval a script at a url from the same origin as this library, use instead bu_Runtime.readEval or bu_require .

Several different implementation mechanisms are potentially available, according to the environment:

Regardless of mechanism, it is generally limited to loading data or script from the same origin as the library itself.

Some of the parameters that affect whether functionality is available include:


Public Member Functions

void getTextAsync (String url, Function handler, Boolean nocache)
 Request the text content of the specified url, and call the handler when it arrives.

abstract void getDocumentAsync (String url, Function handler)
 Get a Document object from the specified url asynchronously.


Protected Member Functions

abstract void getTextAsync_ (String url, Function handler)
 The method the subclass must implement (AbstractURIRequest takes care of caching).


Member Function Documentation

abstract void burst.io.AbstractURIRequest.getDocumentAsync String  url,
Function  handler
[pure virtual]
 

Get a Document object from the specified url asynchronously.

This is implemented with HttpRequest if available, otherwise via a hidden iframe.

There is no return value. The handler function is called with the Document object as its firstu argument.

Todo:
when will responseXML be null? When is parseError set?
Parameters:
url the url to load.
handler a function called with the Document object

void burst.io.AbstractURIRequest.getTextAsync String  url,
Function  handler,
Boolean  nocache
 

Request the text content of the specified url, and call the handler when it arrives.

If HttpRequest is available in the environment, that is used. Otherwise an iframe mechanism is used.

There is no return value. The handler is called with a first argument containing the text content. The second argument is the implementation-specific request object.

This function does not provide detailed control over such things as authentication, progress callback, and so on. For that, you would need to explicitly create an HttpRequest and use its methods directly.

Parameters:
url The url to load
handler The callback, which will be passed in the content text.
nocache Optional. If true, it disables a global by-url cache.

Todo:
make sure we never cache if the request failed.


The documentation for this class was generated from the following file:
Generated on Tue Nov 30 04:03:08 2004 for BurstProject by doxygen 1.3.4