搜索

这个是什么意思?alert是弹 出提示,后面的内容怎么改成中文?

发布网友 发布时间:2022-02-26 12:24

我来回答

1个回答

热心网友 时间:2022-02-26 13:54

你好,这个是一种字符编码,可以转出来的。

你上面这句转出来是: alert("程序错误:节点还没生成:"+a)
下面把源代码也发给你,你把代码保存为HTML后打开就可以进行转换了。这里面有三种转换,你自己试下。

希望我的回答对你有帮助。

<!DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<htmlxmlns="http://www.w3.org/1999/xhtml">
<head>
<metahttp-equiv="Content-Type"content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<styletype="text/css">
<!--
.btn{
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
color: #666666;
text-align: left;
text-decoration: none;
display: block;
overflow: visible;
margin-right: 10px;
margin-left: 10px;
}
.btn a:hover {
background-color: #d8dfea;
border-top-width: 1px;
border-bottom-width: 1px;
border-top-style: solid;
border-bottom-style: solid;
border-top-color: #333366;
border-bottom-color: #333366;
}
.btn a {
display: block;
text-decoration: none;
color: #666666;
border-top-width: 1px;
border-bottom-width: 1px;
border-top-style: solid;
border-bottom-style: solid;
border-top-color: #CCCCCC;
border-bottom-color: #CCCCCC;
width: 100px;
padding-top: 5px;
padding-right: 10px;
padding-bottom: 5px;
padding-left: 30px;
overflow: visible;
float: left;
}
html {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
color: #333333;
line-height: 18px;
margin: 0px;
}
-->
body{
margin:0px;
}
</style>
</head>
<body>
<p>
<textareaname="source"rows="14"id="source"style="width:99%">
海南
长春
南昌
上海
深圳
青岛
郑州
长沙
</textarea>
</p>
<divclass="btn">
<ahref="javascript:action('CONVERT_FMT1')">
<strong>Convert</strong><br />
Fmort &#xxxx </a></div>
<divclass="btn">
<ahref="javascript:action('CONVERT_FMT2')">
<strong>Convert</strong><br />
Fmort \uxxxx
</a>
</div>
<divclass="btn">
<ahref="javascript:action('RECONVERT')">
<strong>ReConvert</strong><br />
To 汉字 </a>
</div>
<p>
<divid="tt"style="display:none"></div>
<textareaname="show2"rows="14"id="show2"style="width:99%"></textarea>
</p>
</body>
</html>
<scriptlanguage="javascript"type="text/javascript">
var oSource = document.getElementById("source");
var oShow2 = document.getElementById("show2");
var oTt = document.getElementById("tt");
function action(pChoice){
switch(pChoice){
case"CONVERT_FMT1":
oShow2.value = ascii(oSource.value);
break;
case"CONVERT_FMT2":
oShow2.value = unicode(oSource.value);
break;
case"RECONVERT":
oShow2.value = reconvert(oSource.value);
break;
}
}
function ascii(str){
return str.replace(/[^\u0000-\u00FF]/g,function($0){return escape($0).replace(/(%u)(\w{4})/gi,"\&#x$2;")});
}
function unicode(str){
return str.replace(/[^\u0000-\u00FF]/g,function($0){return escape($0).replace(/(%u)(\w{4})/gi,"\\u$2")});
}
function reconvert(str){
str = str.replace(/(\\u)(\w{4})/gi,function($0){
return (String.fromCharCode(parseInt((escape($0).replace(/(%5Cu)(\w{4})/g,"$2")),16)));
});
str = str.replace(/(&#x)(\w{4});/gi,function($0){
return String.fromCharCode(parseInt(escape($0).replace(/(%26%23x)(\w{4})(%3B)/g,"$2"),16));
});
return str;
}
</script>
声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。
E-MAIL:11247931@qq.com
Top