火狐
父页面:charset是utf8
现在想创建一个iframe页面:charset is gbk
但火狐似乎无法设置字符集
var doc = window.content.document;
var iframe=doc.createElement("iframe");
iframe.src="about:blank";
iframe.setAttribute("style","display:none;visibility:hidden;");
doc.body.appendChild(iframe);
var d;
if(iframe.contentDocument) {
d = iframe.contentDocument;
} else {
d = iframe.contentWindow.document;
}
d.charset=d.characterSet="GBK";
d.documentElement.innerHTML="<body><span>some GBK</span></body>";