Namespace: ajax

FusionCharts. ajax

Members

FusionCharts framework level API

<static> headers

The default http-headers that are sent with every AJAX request to the server. More can be added and existing items can be modified.

Properties:
Property Description
"If-Modified-Since"
Type:
string
Default:
Sat, 29 Oct 1994 19:43:31 GMT

Prevents cacheing of AJAX requests.

"X-Requested-With"
Type:
string
Default:
XMLHttpRequest

Lets the server know that this is an AJAX request.

"X-Requested-By"
Type:
string
Default:
FusionCharts

Lets server know which web application is sending requests.

Accept
Type:
string
Default:
text/plain, */*

Mentions content-types that are acceptable for the response. Some servers require this for Ajax communication.

"Content-Type"
Type:
string
Default:
application/x-www-form-urlencoded; charset=UTF-8

The MIME type of the body of the request along with its charset.

<inner> counters

These counters keep a track of various http requests sent by FusionCharts. These can be retrieved using FusionCharts.ajax.stats

Properties:
Property Description
objects
Type:
number

The number of internal Ajax objects created by FusionCharts. This is not same as XMLHttpRequest object since one Ajax object can have a number of XMLHttpRequest objects.

xhr
Type:
number

A count of all XMLHttpRequest objects created.

requests
Type:
number

Sum of all requests sent to server (both GET and POST.)

success
Type:
number

The total number of requests that had a successful return from server.

failure
Type:
number

The total number of requests that failed to communicate with server due to various factors.

idle
Type:
number

XMLHttpRequest objects that are idle for later use or has not been disposed yet.

Methods

<static> stats(type) → {FusionCharts.ajax~counters}

Returns the statistics of AJAX requests sent by FusionCharts.

Parameters:
Parameter Description
type
Type:
string
Attributes:
<optional>

Optionally, one can request a specific type of statistic by providing the type as one of the property-name of FusionCharts.ajax~counters.

Returns:

If no specific nature of statistics is passed to the type parameter, this function would return an object containing all counters, otherwise it returns a specific counter as in FusionCharts.ajax~counters.

Type:

FusionCharts.ajax~counters