dh20156风之石的专栏

@CSDN.net @V-EC.com @INTERNET @YOUR LIFE

用户操作
[即时聊天] [发私信] [加为好友]
dh20156风之石ID:dh20156
42410次访问,排名2651(1)好友24人,关注者113
向大家学习! ^_^
dh20156的文章
原创 55 篇
翻译 1 篇
转载 2 篇
评论 78 篇
dh20156风之石的公告
昵称: 风之石
位置: 中国,广东

最近评论
菜鸟:怎样获取选择的是那个值 ,怎样写
zj:如果text值 和Value值是不相同 例如 1 产品1 2 产品2 这样的话在文本框中显示的是1,2 而不是我选择的产品,还有就是我怎么知道它选择的是那个值呢?


我是个菜鸟还望高手帮我
shizhusz110:请问大哥怎么控制控件位置
jsgswjtu:D哥,能否提供思路:在已有的基础上,按拼音首字母匹配?(拼音首字母可以事先定义在数组中)
dh20156:呵呵 ^_^
文章分类
收藏
    相册
    岁月无声
    学习资源
    dh20156风之石的专栏
    风之石的MSN SPACE
    友情链接
    dh20156风之石的家乡博客(RSS)
    威驰软件、威驰社区、威驰网店的官方站点,http://www.v-ec.com/
    存档
    订阅我的博客
    XML聚合  FeedSky
    订阅到鲜果
    订阅到Google
    订阅到抓虾
    订阅到BlogLines
    订阅到Yahoo
    订阅到GouGou
    订阅到飞鸽
    订阅到Rojo
    订阅到newsgator
    订阅到netvibes

    原创 汉字与unicode字符互相转换处理乱码收藏

    新一篇: 春游,烧烤,钓鱼 | 旧一篇: JS版数字转中文货币金额大写

    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    </head>
    <body>
    <div id="div1">汉字与unicode字符转换</div>
    <textarea id="uc" style="width:300px;height:150px;border:1px buttonface solid;"></textarea>
    <br/>
    <textarea id="txtboxA" name="txtboxA" style="width:300px;height:150px;border:1px buttonface solid;"></textarea>
    <input type="button" value="Change Code To Unicode" onclick="CCTU(txtboxA.value,0);">
    <br/>
    <script language="javascript">
    //unicode to chinese
    var s = "&#20013";
    var s = s.substr(2);//去掉&#
    document.write(String.fromCharCode(parseInt(s,10)));//从Unicode字符值中返回一个字符串

    a = "&#x6c88;&#x9633;a,b,c."
    b = a.replace(/&#x/gi,"");//去掉&#
    b= b.split(";")//分割字符串
    for(i = 0;i<b.length-1;i++){
     document.write(String.fromCharCode(parseInt(b[i],16)));//从Unicode字符值中返回一个字符串
    }

    //chinese to unicode
    function CCTU(str,htmlct){//writed by dh20156
     if(htmlct==null) htmlct = false;
     var rega = /^[\u4E00-\u9FA5]*$/;
     var regb = /([\uFF00-\uFF80])/;
     var regc = /。/;
     var regd = /\r/;
     var newstr = new Array();
     var nid = 0;
     for(var i=0;i<str.length;i++){
      var ts = str.charAt(i);
      if(rega.test(ts) || regb.test(ts)){
       newstr[nid++] = "&#"+ts.charCodeAt(0)+";";//从指定位置上字符返回Unicode编码
      }else if(regc.test(ts)){
       newstr[nid++] = ".";
      }else if(regd.test(ts) && htmlct){
       newstr[nid++] = "<br/>";
      }else{
       newstr[nid++] = ts;
      }
     }
     document.getElementById("div1").innerHTML = newstr.join('');
     document.getElementById("uc").value = newstr.join('');
    }
    </script>
    </body>
    </html>

    发表于 @ 2007年04月07日 11:34:00|评论(loading...)|编辑

    新一篇: 春游,烧烤,钓鱼 | 旧一篇: JS版数字转中文货币金额大写

    评论:没有评论。

    发表评论  


    登录
    Csdn Blog version 3.1a
    Copyright © dh20156风之石