не отрабатывает скрипт в IE
подскажите пожалуйста почему в IE не отрабатывает скрипт:
function getperson2(){ var s = document.getElementById("fio").value; var ff = document.getElementById("findfio"); if (s.length < 3) { ff.style.display = "none"; document.getElementById("depart").value = ''; document.getElementById("prof").value = ''; document.getElementById("phone").value = ''; }else{ ff.style.display = "block"; var xmlhttp; if (window.XMLHttpRequest){ xmlhttp=new XMLHttpRequest(); } xmlhttp.onreadystatechange=function(){ if (xmlhttp.readyState==4 && xmlhttp.status==200){ ff.innerHTML = xmlhttp.response; } } xmlhttp.open("GET","getpersons2.asp?fio="+s,true); xmlhttp.send(); } } |
oryth,
function getXmlHttp(){ try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch (ee) { } } if (typeof XMLHttpRequest!='undefined') { return new XMLHttpRequest(); } } |
destus,простите, а куда это вставить?
|
function getXmlHttp(){ try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch (ee) { } } if (typeof XMLHttpRequest!='undefined') { return new XMLHttpRequest(); } } function getperson2(){ var s = document.getElementById("fio").value; var ff = document.getElementById("findfio"); if (s.length < 3) { ff.style.display = "none"; document.getElementById("depart").value = ''; document.getElementById("prof").value = ''; document.getElementById("phone").value = ''; }else{ ff.style.display = "block"; var xmlhttp = getXmlHttp(); xmlhttp.onreadystatechange=function(){ if (xmlhttp.readyState==4 && xmlhttp.status==200){ ff.innerHTML = xmlhttp.response; } } xmlhttp.open("GET","getpersons2.asp?fio="+s,true); xmlhttp.send(); } } |
к сожалению, не хочет, такая мысль, что не передается параметр s, так как если написать в getpersons2.asp просто написать текст то он его вставляет вот кстати код getpersons2.asp
fiof = request.querystring("fio") sql = "SELECT * " sql = sql & "FROM таблица " sql = sql & "WHERE Full_Name LIKE '" & fiof & "%' ORDER BY Full_Name" set conn = Server.CreateObject("ADODB.Connection") Conn.Open "string connection......" set rs = Server.CreateObject("ADODB.recordset") rs.Open sql,conn resp = "<table class=""tff"" cellspacing=""0"">" do while not rs.eof resp = resp & "<tr id=""" & rs("num_tab") & """ onclick=""clickff(this.id);"">" resp = resp & "<td class=""tffc1"">" & rs("Full_Name") & "</td>" resp = resp & "<td class=""tffc2"">" & rs("firm") & "</td>" resp = resp & "<td>" & rs("Expr1") &"</td>" resp = resp & "<td>" & rs("Name_appoint") & "</td>" resp = resp & "</tr>" rs.Movenext loop resp = resp & "</table>" response.write(resp) rs.close: set rs=nothing conn.close |
в других броузерах все работает, а вот в IE нет
|
в IE вставляет не таблицу, а undefined
|
добился что выводит квадраты, я так понимаю все браузеры кроме IE передает в utf8, а вот ie видимо в 1251, поэтому квадраты. как сделать что принудительно поставить utf-8?
|
|
стоит IIS 7.5 по умолчанию на весь сайт кодировка utf-8, все файлы написаны в кодировки utf-8 не понимаю, так полагаю что ошибка в этой в строке :
xmlhttp.open("GET","getpersons2.asp?fio="+s,false) ; - видимо s передается в кодировке не utf-8, при выводе этого параметра выводятся квадраты если выводить на английском то нормально все |
Часовой пояс GMT +3, время: 02:42. |