您的位置:首页 > 运维架构

window.open一个新窗口后,用document.writeln写入时的编码设定

2009-12-16 23:59 260 查看
参考代码:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
 <meta http-equiv="Content-Type" content="text/html; charset=Shift-JIS">
 <title>Untitled</title>
 <mce:script type="text/javascript" charset="Shift-JIS"><!--
  function xpx(){
   var wo = window.open("test2.html","_blank", "charset=Shift-JIS");
   var srcstr = "<!DOCTYPE HTML PUBLIC /"-//W3C//DTD HTML 4.0 Transitional//EN/"><html><head><meta http-equiv=/"Content-Type/" content=/"text/html; charset=Shift-JIS/"><title>Untitled</title></head><body><span id=/"prait/">//adsfasfefeae</span></body></html>";
   wo.document.writeln(srcstr);
   wo.document.all.prait.innerHTML = document.all.er.innerHTML;
   wo.document.charset ="Shift-JIS";
  }
 
// --></mce:script>
</head>

<body>

<input type="button" value="123" id="xxx" onclick="xpx()">Hello World!
<span id="er">/123124151</span>
</body>
</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: