汉字转简拼,JavaScript汉字,简拼,javascript汉字转拼音主要用于模糊查询,或者快速查找 代码如下 <!DOCTYPE html><html lang="en"> <head> <meta charset="utf-8"> <!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame Remove this if you use the .htaccess --> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <title>汉字简拼</title> <meta name="description" content=""> <meta name="author" content="Administrator"> <meta name="viewport" content="width=device-width; initial-scale=1.0"> <!-- Replace favicon.ico & apple-touch-icon.png in the root of your domain and delete these references --> <link rel="shortcut icon" href="/favicon.ico"> <link rel="apple-touch-icon" href="/apple-touch-icon.png"> </head> <body> <center> <input type="text" id="wordC" /> <input type="button" id="btn" value="获取简拼" /> <h1 id="wordE"> </h1> </center> </body> <script type="text/javascript"> window.onload = function() { document.getElementById("btn").onclick = function() { var wordC = document.getElementById("wordC").value; var wordE = letterArr(wordC); document.getElementById("wordE").innerHTML = wordE.toUpperCase(); }; //获取字符串首字母 /** * arrInitialChart数组将unicode 19968-40869 编码分为26个元素,每个元素的首字母都相同,按英文字符排序 * arrNumLetter数组为每个arrInitialChart数组的元素id所对应的英文字母 * arrPolyphone数组为377个声母不同的多音字的首字母字符串 */ var arrInitialChart = new Array(); arrInitialChart[0]="伌侒俺傲僾儑凒凹厑厫哀哎唉唵啀啊啽嗄嗌嗳嗷嗸嘊噯坳垇垵埃埯堓塧壒奡奥奧婩媪嫒嫯嬡安岇岙岰岸峖嶅嶴庵廒愛慠懊懓扷按挨捱揞擙敖敳昂昹昻暗暧曖枊柪案桉毐氨溰溾滶澳熬爊爱犴獒獓瑷璈璦癌皑皚皧盎盦盫瞹矮砹硋碍罯翱翶翺聱肮胺腤艾芺荌萻蓭蔜蔼薆藹螯袄 汉字转简拼,JavaScript汉字,简拼,javascript汉字转拼音
|