判断数据是否为字符串类型:
<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>