易截截图软件、单文件、免安装、纯绿色、仅160KB

如何判断javascript中参数类型,对象类型。

一般:object.constructor == String ;(String 或者Number 等等 )
特殊:判断一个数组Array
方法1:
Object
.prototype.toString.apply(value) ===
'[object Array]'
方法2:
 用jQuery,其实和方法1同。
$.isArray(object);


相关文档:

JavaScript 简单项目应用技巧

1.<select></select>标签应用
    通常的写法是:
    <select onchange="javascript:windwo.open(this.options[this.selectedIndex].value)">
        <option>MAIN</option>
      & ......

javascript 中常用的55个经典技巧

1. oncontextmenu="window.event.returnValue=false" 将彻底屏蔽鼠标右键
<table border oncontextmenu=return(false)> <td>no </table> 可用于Table
2. <body onselectstart="return false"> 取消选取、防止复制
3. onpaste="return false" 不准粘贴
4. oncopy="return false;" oncut="re ......

7 JavaScript Differences Between Firefox & IE

Although the days of long and tedious code branches to target specific browsers in JavaScript are over, once in a while it's still necessary to do some simple code branching and object detection to ensure that a certain piece of code is working properly on a user's machine. 
In this article, I ......

javascript Html 导出为word excel

<HTML>
<HEAD>
<title>WEB页面导出为EXCEL文档的方法
</title>
</HEAD>
<body>
<BR>
<table id = "PrintA" width="100%" border="1" cellspacing="0" cellpadding="0" bgcolor = "#61FF13">
<TR style="text-align : center;" mce_style="text-ali ......

JavaScript KeyCode数字键盘对应

keycode    8 = BackSpace BackSpace
keycode    9 = Tab Tab
keycode   12 = Clear
keycode   13 = Enter
keycode   16 = Shift_L
keycode   17 = Control_L
keycode   18 = Alt_L
keycode   19 = Pause
keyc ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号