JavaScript text in accordance with the pinyin sorting implementation code
<title>JavaScript Sort words by pinyin </title><SCRIPT type="text/javascript">function defaultSort(){var a="zhongguo,daguo, The world , China , The superpower ";a=a.split(",");a.sort();alert(a);}function cusSort(){var a="zhongguo,daguo, The world , China , The superpower ";a=a.split(",");a.sort(function(a,b){ return a.localeCompare(b);});alert(a);}</SCRIPT><a href="#" onClick="defaultSort();"> The default sort </a><br><a href="#" onClick="cusSort();"> In alphabetical order </a>