可能你不想用户直接复制数字,或不想让自动抓取程序获取的QQ号。那可以将数字替换成汉字或其他用户可是识别的文字!
var num1 = '0123456789'; var num2 = '零一二三四五六七八九'; var num3 = '0123456789'; var num4 = '零壹贰叁肆伍陆柒捌玖'; var num5 = '〇㈠㈡㈢㈣㈤㈥㈦㈧㈨'; var num6 = '〇ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩ'; var num7 = '〇①②③④⑤⑥⑦⑧⑨'; var num8 = '〇⒈⒉⒊⒋⒌⒍⒎⒏⒐'; var num9 = '〇⑴⑵⑶⑷⑸⑹⑺⑻⑼'; var z1 = 'abcdefghijklmnopqrstuvwxyz'; var z2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; var z3 = '⒜⒝⒞⒟⒠⒡⒢⒣⒤⒥⒦⒧⒨⒩⒪⒫⒬⒭⒮⒯⒰⒱⒲⒳⒴⒵'; var z4 = 'ⓐⓑⓒⓓⓔⓕⓖⓗⓘⓙⓚⓛⓜⓝⓞⓟⓠⓡⓢⓣⓤⓥⓦⓧⓨⓩ'; var month = '㋀㋁㋃㋂㋄㋅㋆㋇㋈㋉㋊㋋'; var day = '㏠㏡㏢㏣㏤㏥㏦㏧㏨㏩㏪㏫㏬㏭㏮㏯㏰㏱㏲㏳㏴㏵㏶㏷㏸㏹㏺㏻㏼㏽㏾'; var hour = '㍘㍙㍚㍛㍜㍝㍞㍟㍠㍡㍢㍣㍤㍥㍦㍧㍨㍩㍪㍫㍬㍭㍮㍯㍰'; function showNum(o, num) { var strHTML = ''; num += ''; for (n=0; n< num.length; n++){ strHTML += o.charAt(parseInt(num.charAt(n),10)); } document.write(strHTML); document.write('<br>'); } function showZ(o, str) { var strHTML = ''; for (n=0; n< str.length; n++){ var chr = str.charAt(n); var index = z1.indexOf(chr); if(index == -1)index = z2.indexOf(chr); strHTML += (index == -1 ? chr : o.charAt(index)); } document.write(strHTML); document.write('<br>'); } function showDay(m, d, h) { var strHTML = ''; strHTML += month.charAt(m-1); strHTML += day.charAt(d-1); if(h != null){ strHTML += hour.charAt(h); } document.write(strHTML); document.write('<br>'); }