wsepr wsepr
关注数: 24 粉丝数: 64 发帖数: 605 关注贴吧数: 12
教你输入“不能复制”的文字!! 看过几个帖子,这字符编码挺有意思的,呵呵。写了个小程序把字符转换成编码,发帖时把编码复制上去就行了。比如惇的编码是& # 24775大家试试吧,祝各位新年快乐(*^__^*) 嘻嘻……使用方法:把以下代码另存为html文件,如code.html,用浏览器打开 编码 &#9function getCode() &#9{ &<a href="http://tieba.baidu.com/mo/q/hotMessage?topic_id=0&fid=0&topic_name=9&amp;&is_video_topic=0">#9&amp;#</a>9var txt = document.getElementById("txt").value; &<a href="http://tieba.baidu.com/mo/q/hotMessage?topic_id=0&fid=0&topic_name=9&amp;&is_video_topic=0">#9&amp;#</a>9var output = document.getElementById("output"); &<a href="http://tieba.baidu.com/mo/q/hotMessage?topic_id=0&fid=0&topic_name=9&amp;&is_video_topic=0">#9&amp;#</a>9var temp = ""; &<a href="http://tieba.baidu.com/mo/q/hotMessage?topic_id=0&fid=0&topic_name=9&amp;&is_video_topic=0">#9&amp;#</a>9for(i=0;i<txt.length;i++) &<a href="http://tieba.baidu.com/mo/q/hotMessage?topic_id=0&fid=0&topic_name=9&amp;&is_video_topic=0">#9&amp;#</a>9{ &<a href="http://tieba.baidu.com/mo/q/hotMessage?topic_id=0&fid=0&topic_name=9&amp;&is_video_topic=0">#9&amp;#</a>9&#9temp += "&#"+txt.charCodeAt(i); &<a href="http://tieba.baidu.com/mo/q/hotMessage?topic_id=0&fid=0&topic_name=9&amp;&is_video_topic=0">#9&amp;#</a>9} &<a href="http://tieba.baidu.com/mo/q/hotMessage?topic_id=0&fid=0&topic_name=9&amp;&is_video_topic=0">#9&amp;#</a>9output.value = temp; &#9} &#9function copy() &#9{ &<a href="http://tieba.baidu.com/mo/q/hotMessage?topic_id=0&fid=0&topic_name=9&amp;&is_video_topic=0">#9&amp;#</a>9var output = document.getElementById("output"); &<a href="http://tieba.baidu.com/mo/q/hotMessage?topic_id=0&fid=0&topic_name=9&amp;&is_video_topic=0">#9&amp;#</a>9var textRange = output.createTextRange(); &<a href="http://tieba.baidu.com/mo/q/hotMessage?topic_id=0&fid=0&topic_name=9&amp;&is_video_topic=0">#9&amp;#</a>9textRange.execCommand("Copy"); &<a href="http://tieba.baidu.com/mo/q/hotMessage?topic_id=0&fid=0&topic_name=9&amp;&is_video_topic=0">#9&amp;#</a>9alert("代码已经复制,用Ctrl+V粘贴"); &#9} 输入字符:
1 下一页