我的網站:www.egemen.dkInternet Explorer將不會發送特殊字符
我正在開發一個網站,並在IE上有特殊字符的問題。在我的網站上有一個包含多個姓氏的下拉框。這些姓氏可以包含特殊字符,如ô,ô,ö等等。當從數據庫獲取這些姓氏以構建下拉列表並且特殊字符顯示正確時,一切正常,但是,用戶應該能夠選擇姓氏並執行搜索。當選擇具有特殊字符的姓氏時,代碼調用javascript方法連接到數據庫。在FF和Safari瀏覽器中工作,但IE瀏覽器無法正確發送這些特殊字符到JavaScript。任何想法?
的Javascript:
<script>
function searchUser(str)
{
var call ="/Data/controller.php?cmd="+str;
if(str == "searchByName"){
call += "&name=" + document.getElementById("s_name").value;
call += "&lname=" + document.getElementById("s_lname").value;
}
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET", call ,true);
xmlhttp.send();
}
</script>
的index.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1 /DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
我也曾嘗試使用UTF-8作爲元的字符集。
您正在測試什麼版本的IE? – Spudley
「不正確」是什麼樣子?你得到了什麼? – deceze