js window.open 弹出窗口设置 UTF-8编码的问题解决
来源:互联网 发布:写出数据库的关系模式 编辑:程序博客网 时间:2024/06/02 06:59
js window.open 弹出窗口设置 UTF-8编码的问题解决
发现弹出空白窗口时,页面为unicode编码,查询了下,发现document.write默认使用unicode编码。后来可以用pwin.document.charset=”UTF-8″;语句来解决编码问题。
function log() {
var newwindow=window.open('about:blank');
var printerCode = $("#printerCode").val();
var logUrl= getRootPath().replace("HsCloudPrint","") + "HsFiles/logFiles/"+printerCode+".log";
htmlobj=$.ajax({url:logUrl,type:"get", contentType: "application/x-www-form-urlencoded; charset=utf-8", async:false});
if(htmlobj.status=="200"){
newwindow.document.write(htmlobj.responseText);
newwindow.document.charset="UTF-8";
}else{
newwindow.close();
}
}
var printerCode = $("#printerCode").val();
var logUrl= getRootPath().replace("HsCloudPrint","") + "HsFiles/logFiles/"+printerCode+".log";
htmlobj=$.ajax({url:logUrl,type:"get", contentType: "application/x-www-form-urlencoded; charset=utf-8", async:false});
if(htmlobj.status=="200"){
newwindow.document.write(htmlobj.responseText);
newwindow.document.charset="UTF-8";
}else{
newwindow.close();
}
}
0 0
- js window.open 弹出窗口设置 UTF-8编码的问题解决
- window.open 窗口弹出js
- 弹出窗口 JS window.open()属性
- JS中window.open弹出窗口居中
- JS中window.open弹出窗口居中
- JS弹出窗口Window.Open详解
- window.open弹出窗口
- window.open() 弹出窗口
- window.open() 弹出窗口
- js设置window.open弹出框
- 弹出窗口window.open()的参数列表
- window.open的弹出窗口居中
- 弹出窗口window.open()的参数列表
- 弹出窗口window.open()的参数列表
- window.open()弹出居中的窗口
- window.open弹出窗口代码
- window open 弹出窗口方法
- window.open 弹出居中窗口
- java__switch转换百分制为分级制
- Easygui简单说明教程(python的GUI类库)
- flex+oracle分页功能
- 动态网页开发基础
- JSP网页计数器
- js window.open 弹出窗口设置 UTF-8编码的问题解决
- 解决iscroll.js上拉下拉刷新手指划出屏幕页面无法回弹问题
- 关于sql语句Top在mysql中无效的解决方案
- 解决浏览器记住密码输入框的问题
- java__while do while购买商品结算系统两种
- TCP/IP协议簇
- Deep Learning---win10 搭建caffe开发环境(GPU)
- Go1.8抓取网络数据包
- java OSCache Util