add reset method to ajax object
This commit is contained in:
parent
103a23a5d6
commit
843342d188
1 changed files with 10 additions and 4 deletions
|
@ -13,10 +13,7 @@ namespace Sakura
|
||||||
|
|
||||||
// Prepares the XMLHttpRequest and stuff
|
// Prepares the XMLHttpRequest and stuff
|
||||||
constructor(async: boolean = true) {
|
constructor(async: boolean = true) {
|
||||||
this.Request = new XMLHttpRequest();
|
this.Reset(async);
|
||||||
this.Callbacks = new Object();
|
|
||||||
this.Headers = new Object();
|
|
||||||
this.Asynchronous = async;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start
|
// Start
|
||||||
|
@ -51,6 +48,15 @@ namespace Sakura
|
||||||
this.Request = null;
|
this.Request = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Reset(async: boolean = true): void {
|
||||||
|
this.Request = new XMLHttpRequest();
|
||||||
|
this.Callbacks = new Object();
|
||||||
|
this.Headers = new Object();
|
||||||
|
this.Send = null;
|
||||||
|
this.FormData = null;
|
||||||
|
this.Asynchronous = async;
|
||||||
|
}
|
||||||
|
|
||||||
// Set content type required for forms
|
// Set content type required for forms
|
||||||
public Form(): void {
|
public Form(): void {
|
||||||
this.ContentType("application/x-www-form-urlencoded");
|
this.ContentType("application/x-www-form-urlencoded");
|
||||||
|
|
Reference in a new issue