## setting.callback.onAsyncError

## Function(event, treeId, treeNode, XMLHttpRequest, textStatus, errorThrown)

### Overview[ depends on jquery.ztree.core js ]

Used to capture the error event when execute ajax.

If you set 'setting.callback.beforeAsync',and return false, zTree will not execute ajax, and will not trigger the 'onAsyncSuccess / onAsyncError' callback.

Default: null

### Function Parameter Descriptions

#### event js event Object

event Object

#### treeId String

zTree unique identifier: treeId.

#### treeNode JSON

JSON data object of the parent node

When load root nodes, treeNode = null

#### XMLHttpRequest String

XMLHttpRequest Object, please refer to JQuery API documentation.

#### textStatus String

a string categorizing the status of the request("success", "error"...), please refer to JQuery API documentation.

#### errorThrown String

eWhen an HTTP error occurs, errorThrown receives the textual portion of the HTTP status, please refer to JQuery API documentation.

### Examples of setting & function

#### 1. When execute ajax make error, alert message.

    function myOnAsyncError(event, treeId, treeNode, XMLHttpRequest, textStatus, errorThrown) {
        alert(XMLHttpRequest);
    };
    var setting = {
    	callback: {
    		onAsyncError: myOnAsyncError
    	}
    };
    ......