摘要: 一、typeof语法为typeofdata,可能返回number,boolean,string,object,undefined,functiontypeof"John"// Returns stringtypeof3.14// Returns numbertypeoffalse// Returns... 阅读全文
posted @ 2014-08-18 00:30 xjinza 阅读(889) 评论(0) 推荐(0) 编辑
摘要: 用.submit( handler )方式提交,不需要用onsubmit,直接在handler进行表单验证.为了阻止Enter提交表单,当按下Enter键时阻止表单默认行为。 姓名: 阅读全文
posted @ 2014-08-13 01:38 xjinza 阅读(137) 评论(0) 推荐(0) 编辑
摘要: keypress:在IE和chrome中主要用来捕获数字(注意:包括Shift+数字的符号)、字母(注意:包括大小写)、小键盘等除了F1-12、SHIFT、Alt、Ctrl、Insert、Home、PgUp、Delete、End、PgDn、ScrollLock、Pause、NumLock、{菜单键}... 阅读全文
posted @ 2014-08-13 01:25 xjinza 阅读(1195) 评论(0) 推荐(0) 编辑
摘要: jquery写法 keyCode:IE、Chrome支持,在FF下,keyCode返回非字符按键的Unicode,如果是字符按键返回始终为0。 which: FF,Chrome支持;在IE下,which和charCode始终为undefined ,jquery方式下和keyCode值相同。cha... 阅读全文
posted @ 2014-08-13 00:23 xjinza 阅读(969) 评论(0) 推荐(0) 编辑
摘要: keyCode:IE、Chrome支持,在FF下,keyCode返回非字符按键的Unicode,如果是字符按键返回始终为0。 which: FF,Chrome支持;在IE下,which和charCode始终为undefined ,jquery方式下和keyCode值相同。charCode: C... 阅读全文
posted @ 2014-08-13 00:19 xjinza 阅读(853) 评论(0) 推荐(0) 编辑
摘要: Forms and their child elements should not use input names or ids that conflict with properties of a form, such as submit, length, or method. Name conf... 阅读全文
posted @ 2014-08-12 14:42 xjinza 阅读(299) 评论(0) 推荐(0) 编辑
摘要: 当用户在文本框中进行编辑时,按下键盘Enter键,会触发表单提交。为了防止这种意外,有一种方法就是拒绝所有表单提交,然后通过单击指定的提交命令按钮才能提交表单。首先,将"return false"绑定到表单的onsubmit事件,来阻止所有表单提交。第二,使用input="button"通过oncl... 阅读全文
posted @ 2014-08-12 13:30 xjinza 阅读(310) 评论(0) 推荐(0) 编辑
摘要: 一、用input type="submit"方式提交表单该方法可以触发onsubmit事件,但无法通过onclick进行校验,也就是说formSubmit函数里面的return false是无效的。所以只能通过onsubmit来进行表单校验。 姓名: 阅读全文
posted @ 2014-08-12 12:02 xjinza 阅读(1597) 评论(0) 推荐(0) 编辑
摘要: 二、用input type="button"方式提交表单该方法提交表单的方式与用户单击 Submit 按钮一样,但是表单的 onsubmit 事件句柄不会被调用。所以可以在onclick事件里面进行表单校验。如果换成jquery方式,$("#myForm").submit()会调用onsubmit事... 阅读全文
posted @ 2014-08-12 11:11 xjinza 阅读(2430) 评论(0) 推荐(0) 编辑
摘要: li,list-style,css,ie6 bug 阅读全文
posted @ 2012-09-10 19:43 xjinza 阅读(155) 评论(0) 推荐(0) 编辑