Fixed style

This commit is contained in:
Guillermo Rauch
2012-01-03 13:21:58 -08:00
parent c175b39d8d
commit 122d323634

View File

@@ -141,8 +141,10 @@ util.inherits(Request, EventEmitter);
*/
Request.prototype.create = function () {
var xhr = this.xhr = util.request(this.xd);
this.xhr.open(this.method, this.uri, this.async);
var xhr = this.xhr = util.request(this.xd)
, self = this
xhr.open(this.method, this.uri, this.async);
if ('POST' == this.method) {
try {
@@ -156,9 +158,9 @@ Request.prototype.create = function () {
} catch (e) {}
}
if (this.xd && global.XDomainRequest && this.xhr instanceof XDomainRequest) {
this.xhr.onerror = function () {
self.onError();
if (this.xd && global.XDomainRequest && xhr instanceof XDomainRequest) {
xhr.onerror = function (e) {
self.onError(e);
};
this.xhr.onload = function () {
self.onData(xhr.responseText);