Почему во всех примерах по Ajax не используется this
всегда используется имя переменной запроса, а не this.this не кроссбраузерно.

Странно, конечно

Но если это так, то печально

http://www.quirksmode.org/js/this.html :
Note the presence of attachEvent. The main drawback of the Microsoft event registration model is that attachEvent creates a reference to the function and does not copy it. Therefore it is sometimes impossible to know which HTML currently handles the event.
Но ведь в моем случае, если я напишу так:
request.onreadystatechange = function { ... }
похоже все будет ок, судя по статье, разве нет?
The function is copied in its entirety to the onclick property (which now becomes a method).
So if the event handler is executed this refers to the HTML elemen
Оставить комментарий
wwoland
Небольшой знатоу в JS, но вот возник вопрос, почему во всех примерах по Ajax в callback функцииonreadystatechange всегда используется имя переменной запроса, а не this.
Вопрос возник в связи с тем, что хотел сделать следующее:
Для каждого элемента некоторого массива данных создать свой HTTPRequest и что-то с помощью него сделать.
Может я просто плохо знаком с данной технологией, и это делается как-то принципиально по-другому или вообще не делается ?