<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" " http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>顺网科技</title>
<script type="text/javascript" charset=UTF-8>
function init()
{
var items=[{text:"11菜单一",id:"1"},{text:"22菜单二",id:"2"}];
for(var i in items)
{
var data=items[0];
var outDiv=document.createElement("div");
//outDiv.id=data.id;outDiv.innerHTML=data.text;
var text=document.createTextNode(data.text);
outDiv.appendChild(text)
alert(outDiv.outerText)
document.body.appendChild(outDiv);
}
}
</script>
</head>
<body onload="init()">
</body>
</html>
出现乱码 谁帮我解决一下啊 !