About Pi Downloads Documentation Plugins Developer Forum Issues

pi.xhr.addCallback

Summary

Pi will control the added value call-backs of the changing readyState values. The scope of the executed function is the object pi.xhr.

Syntax

pi.xhr.addCallback([readyState values],function)

Usage Example

>>> new pi.xhr("helloWorld.php").addCallback([3,4],function(){
	trace('readyState: ',this.api.readyState);
	trace('responseText: ',this.api.responseText);
});
"readyState:" 3
"responseText:", ""
"readyState:" 4
"responseText:", "Hello World"