判断数据是否为字符串类型:

<script type="text/javascript"> 
  //<![CDATA[ 
    document.write(isString('test'),'<br/>'); 
    document.write(isString(10),'<br/>'); 
    function isString(str){ 
        return (typeof str=='string')&&str.constructor==String; 
    } 
    //]]> 
</script> 

 

相关文章:

  • 2022-02-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-14
  • 2022-12-23
猜你喜欢
  • 2021-11-30
  • 2022-01-05
  • 2022-12-23
  • 2022-02-18
  • 2022-12-23
相关资源
相似解决方案