Неизвестная ошибка выполнения в moo в IE.

vsa

Новичок
Неизвестная ошибка выполнения в moo в IE.

Ответа поиском не нашел.

При вызове AJAX в IE пишет "Ошибка. Неизвестная ошибка выполнения".
Останавливается на этой строке:

setTimeout(function(){this.update.innerHTML = this.transport.responseText;}.bind(this), 10);

При этом в Firefoxe все в порядке.

Может кто сталкивался? Зарание спасибо.
 

Mr_Max

Первый класс. Зимние каникулы ^_^
Команда форума
responseText;}).bind(this)
 

Mr_Max

Первый класс. Зимние каникулы ^_^
Команда форума
setTimeout((function(){this.update.innerHTML = this.transport.responseText;}).bind(this), 10);
 

vsa

Новичок
Mr_Max
Спасибо но не помогло.

Приведу весь код moo на всякий случай.

//based on prototype's ajax class
//to be used with prototype.lite, moofx.mad4milk.net.

ajax = Class.create();
ajax.prototype = {
initialize: function(url, options){
this.transport = this.getTransport();
this.postBody = options.postBody || '';
this.method = options.method || 'post';
this.onComplete = options.onComplete || null;
this.update = $(options.update) || null;
this.request(url);
},

request: function(url){
this.transport.open(this.method, url, true);
this.transport.onreadystatechange = this.onStateChange.bind(this);
if (this.method == 'post') {
this.transport.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
if (this.transport.overrideMimeType) this.transport.setRequestHeader('Connection', 'close');
}
this.transport.send(this.postBody);
},

onStateChange: function(){
if (this.transport.readyState == 4 && this.transport.status == 200) {
if (this.update)
setTimeout((function(){this.update.innerHTML = this.transport.responseText;}).bind(this), 10);
if (this.onComplete)
setTimeout(function(){this.onComplete(this.transport);}.bind(this), 50);
this.transport.onreadystatechange = function(){};
this.rText = this.transport.responseText;
this.rXML = this.transport.responseXML;
}
},

getTransport: function() {
if (window.ActiveXObject) return new ActiveXObject('Microsoft.XMLHTTP');
else if (window.XMLHttpRequest) return new XMLHttpRequest();
else return false;
}
};
 

algo

To the stars!
Ты вызываешь setTimeout для выражения.

function(){this.update.innerHTML = this.transport.responseText;}.bind(this)

Т.е ты создаешь объект function(), и вызываешь у него метод bind.
Проверь, при этом функция возвращается, прибинденная к нужнему this ?
Или не функция ?

P.s не юзал mootools
 

Geol

Пациент
Была аналогичная проблема в IE
решил тупой сменой элемента-контейнера (принимающего responseText) с <p> на <div>.
 
Сверху