首页 > 代码库 > 守卫剑阁 物品代码 转换工具
守卫剑阁 物品代码 转换工具
<style></style>View Code
<script type="text/javascript">// </script>
<p><style>.btn { font-family: "tahoma", "宋体"; font-size:12pt; color: #003399; border: 1px #003399 solid; color:#006699; border-bottom: #93bee2 1px solid; border-left: #93bee2 1px solid; border-right: #93bee2 1px solid; border-top: #93bee2 1px solid; background-color: #e8f4ff; cursor: hand; font-style: normal ; width:auto; height:40px; float:left;}.txt { font-family: "tahoma", "宋体"; font-size:16pt; color: #003399; border: 1px #003399 solid; color:#006699; border-bottom: #93bee2 1px solid; border-left: #93bee2 1px solid; border-right: #93bee2 1px solid; border-top: #93bee2 1px solid; text-align: center; cursor: hand; font-style: normal ; width:auto; height:36px; float:left;}</style><input id="1" class="txt" type="text" /> <button class="btn" onclick="i2a()" type="button">数字转字符</button> <input id="2" class="txt" type="text" /><br /><br /><br /><input id="3" class="txt" type="text" /> <button class="btn" onclick="a2i()" type="button">字符转数字</button> <input id="4" class="txt" type="text" /><script>function i2a(){ //1919707494 //726c6966 //0x72 0x6c 0x69 ox66 //r l i f var txt1 = document.getElementById("1") var txt2 = document.getElementById("2") txt2.value =null var dif = new Array(0) var x = (parseInt(txt1.value)).toString(16) for(var i=0;i<x.length;i+=2) { dif.push(parseInt(x.slice(i,i+2),16)) } for (var i=0;i<dif.length;i++) { // txt2.value += String.fromCharCode(dif[i]); } //console.log(dif)}function a2i(){ //r l i f //0x72 0x6c 0x69 ox66 //726c6966 //1919707494 var txt3 = document.getElementById("3") var txt4 = document.getElementById("4") txt4.value=null var dif = new Array(0) var x = txt3.value var y ="" for(var i=0;i<x.length;i++) { // dif.push((x[i].charCodeAt()).toString(16)) } for(var i=0;i<dif.length;i++) { // y += dif[i] } txt4.value = parseInt(y,16)}</script><br /><br /><br /></p>
守卫剑阁 物品代码 转换工具
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。