<meta>正则

487 查看

复制代码 代码如下:

var charResult = this.getAttribute("responseText").match(/<meta.*?\Wcharset\s*=\s*(\S+?)["'>\s]/i);
charResult = charResult ? charResult[1] : "gb2312";