textarea中源文件的“汉字”是乱码!怎么办啊?搞了一上午了,大侠帮我!!!
bxxxr 2003-07-22 01:29:13 1.<br>
<textarea id=text1 style="width: 90%; height: 50%">啊阿埃挨哎唉哀皑癌蔼矮艾碍爱隘鞍氨安俺按暗岸胺</textarea><br>
2.<br>
<input id=inpu2 onclick=f_inpu2() type=button value="search 0-3754">
<input id=inpu2a><br>
<iframe id=ifra2 src="about:" width=90% height=50%></iframe><br>
3.<br>
<input id=inpu3 onclick=f_text3() type=button value="source"><br>
<textarea id=text3 style="width: 90%; height: 50%"></textarea><br>
<script>
///////////////////////////// user function //////////////////////////////////
function f_inpu2()
{
tmpsrc='<iframe id=ifra2 src="http://www1.baidu.com/baidu?word='+text1.value.charAt(inpu2a.value)+'"width=90% height=50%></iframe>' //prepare the search char
document.all.ifra2.outerHTML=tmpsrc //run search
inpu2a.value++ //prepare next search
}
function f_text3()
{
text3.value=loadContent(document.getElementById("ifra2").src) //put source to text3
}
function loadContent(strURL) //I get this code from a friend (used for "function f_text3()")
{
var strContent = "";
if (typeof strURL != "string" || strURL == "")return strContent;
try
{
var oProxy = new ActiveXObject("Microsoft.XMLHTTP");
oProxy["Open"]("GET", strURL, false);
oProxy["Send"]();
strContent = oProxy["responseText"];
}
catch(e){status = e.description}
return strContent;
}
</script>
<script>
///////////////////////////// system function /////////////////////////////////
function window.onload()
{
inpu2a.value=0 //set init is null
}
</script>