hi,
i am a newbie to ajax. i have created 2 html file in the following :-
<<< a.html >>>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=big5" />
<title>Admin Page</title>
<script>
function loadURL(cDiv, cURL, cGetPost, cParam)
{
var xmlhttp;
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(cDiv).innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open(cGetPost,cURL,true);
xmlhttp.setRequestHeader("Content-Type","text/html;charset=big5");
xmlhttp.send(cParam);
}
</script>
</head>
<body>
<div id="page-container"><a href="#" onclick="loadURL('content_detail','b.html','POST','');return true;">click here</a></div>
<div id="content_detail"></div>
</body>
</html>
<<< b.html >>>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=big5" />
<title>Untitled Document</title>
</head>
<body>
<p>程式測試</p>
<p> </p>
</body>
</html>
by clicking the 'click here' button, instead of display chinese character, the result show '�{�����', is there anyone can tell me what mistake i have made ? pls help, thanks