Skip to content

arno06/Request

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Request

XMLHttpRequest Wrapper

Dependencies(es6)

None

https://dependencies.arnaud-nicolas.fr/?need=Request.es6

Dependencies (es5)

  • Class
  • EventDispatcher
  • Event

https://dependencies.arnaud-nicolas.fr/?need=Request

Example

function completeHandler(pEvent)
{
	console.log('completeHandler', pEvent);
}

function errorHandler(pEvent)
{
	console.log('errorHandler', pEvent);
}

/**
 * Requête correcte
 */
var url = "index.html";
var params = {};
var method = 'get';//or post
var req = new Request(url, params, method);
req.addEventListener(Event.COMPLETE, completeHandler, false);

/**
 * Requête déclenchant une erreur
 */
url = "404.html";
req = new Request(url, params, method);
req.addEventListener(Event.COMPLETE, completeHandler, false);
req.addEventListener(RequestEvent.ERROR, errorHandler, false);

About

XMLHttpRequest Wrapper

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published