본문 바로가기

Dev Story/dev

[mootools] XHR.js

/*
Script: XHR.js
 Contains the basic XMLHttpRequest Class Wrapper.

License:
 MIT-style license.
*/

/*
Class: XHR
 Basic XMLHttpRequest Wrapper.

Arguments:
 options - an object with options names as keys. See options below.

Options:
 method - 'post' or 'get' - the protocol for the request; optional, defaults to 'post'.
 async - boolean: asynchronous option; true uses asynchronous requests. Defaults to true.
 encoding - the encoding, defaults to utf-8.
 autoCancel - cancels the already running request if another one is sent. defaults to false.
 headers - accepts an object, that will be set to request headers.
 
Events:
 onRequest - function to execute when the XHR request is fired.
 onSuccess - function to execute when the XHR request completes.
 onStateChange - function to execute when the state of the XMLHttpRequest changes.
 onFailure - function to execute when the state of the XMLHttpRequest changes.

Properties:
 running - true if the request is running.
 response - object, text and xml as keys. You can access this property in the onSuccess event.

Example:
 >var myXHR = new XHR({method: 'get'}).send('http://site.com/requestHandler.php', 'name=john&lastname=dorian');
*/

'Dev Story > dev' 카테고리의 다른 글

이미지맵태그 좌표값 읽는 방법  (1) 2007.11.02
SDN AJAX 개발자 리소스 센터  (0) 2007.11.01
[mootools] Ajax.js  (0) 2007.10.16
The server reported an error while performing the "cvs add" command.  (0) 2007.10.08
CVS 관련 링크  (0) 2007.10.02