Хорошо, этот код работает в каждом браузере, кроме IE (опять же, как и следовало ожидать). Код должен обновляться на основе setInterval и делает это обычно во всех других браузерах, кроме IE, который просто не обновляется. Вы можете определить проблему?Еще одна проблема IE с AJAX
var nick = document.getElementById("chatnick").value;
var sessid = document.getElementById("sessid").value;
var room = document.getElementById("roomid").value;
function user_read() {
$.ajax({
type: "GET",
url: "methods.php",
data: {method: "u", room: room},
dataType: "html",
success: function (data, status, xhr) {
$("#userwindow").html(data);
setTimeout(user_read, 10000);
}
});
}
function ajax_read() {
$.ajax({
type: "GET",
url: "methods.php",
data: {method: "r", room: room},
dataType: "html",
success: function (data, status, xhr) {
$("#chatwindow").html(data);
setTimeout(ajax_read, 400);
}
});
}
function submit_msg() {
var msg = document.getElementById("chatmsg").value;
$.ajax({
type: "GET",
url: "methods.php",
data: {method: "w", room: room, m: msg, n: nick, sessid: sessid},
dataType: "html",
success: function (data, status, xhr) {
}
});
document.getElementById("chatmsg").value = "";
}
function keyup(arg1) {
if (arg1 == 13) submit_msg();
}
setTimeout(function(){ajax_read();}, 400);
user_read();
Почему вы не используете setInterval в событии готовности DOM вместо setTimeout(). Также установите cash: false в настройках ajax. – mohang
Потому что я новичок в JS и jQuery, и не умею манипулировать DOM. – Nik
Настройка кеша: false ничего не делает для IE. – Nik