全角字符unicode值范围:FF00~FFEE

解决方案 »

  1.   

    还有,比如
    var string=http://erefd http://
    怎么样判断string出现了2次以上的http://子字符当然用最好的方法我对js不怎么懂
      

  2.   

    1.
    <script>
    function check(obj)
    {
      obj.value=obj.value.replace(/[\uFF00-\uFFEE]/g,'')
    }
    </script>
    <body>
    <input type=text onkeyup="check(this)">
    </body>
      

  3.   

    2.
    <script>
    var s='var string=http://erefd http://';
    if(s.match(/http:\/\//g).length==2)
    {
      alert('出现了两次')
    }
    </script>
      

  4.   

    function is(){
    var s=document.theForm.textarea.value;
    if(s.match(/http:\/\//g).length==2)
    {
      alert('出现了两次');
    }
    }
      

  5.   

    FF00~FFEE 并不尽然,请参考:http://www.unicode.org/charts/PDF/UFF00.pdf