87,910
社区成员
发帖
与我相关
我的任务
分享
<meta http-equiv="Content-Type" content="text/html; charset=GBK" />
<script type="text/javascript">
function encodeURL(s) {
var img = document.createElement("img");
window.vbsval = "";
function escapeDBC(s) {
if (!s) return ""
if (window.ActiveXObject) return s.replace(/[\d\D]/g, function($0) {
execScript('window.vbsval=Hex(Asc("' + $0 + '"))', "vbscript");
return "%" + window.vbsval.slice(0,2) + "%" + window.vbsval.slice(-2);
});
img.src = "乱填?key=" + s;
return img.src.split("key=").pop();
}
return s.replace(/([^\x00-\xff]+)|([\x00-\xff]+)/g, function($0, $1, $2) {
return escapeDBC($1) + encodeURIComponent($2||'');
});
}
alert(encodeURL("文字"));
</script>