myeclipse改变javascript编码格式
window ->perferences->myeclipse->Files and Eidtors ->javaScript
因为MyEclipse保存js文件,中文会出现乱码。按上述方法将编码格式改成中文的编码
实在不行就打开原先的原稿js的文件,复制,粘贴。。。
相关文档:
scrollHeight: 获取对象的滚动高度。
scrollLeft:设置或获取位于对象左边界和窗口中目前可见内容的最左端之间的距离
scrollTop:设置或获取位于对象最顶端和窗口中可见内容的最顶端之间的距离
scrollWidth:获取对象的滚动宽度
offsetHeight:获取对象相对于版面或由父坐标 offsetParent 属性指定的父坐标的高度
offsetL ......
/************** javascript table操作类***************
* 仅适合IE6
****调用示例*****************************************
*
* var table=new TableOption("tb");
*
* var table=new TableOptions("tb",{hoverColor:#aabbcc,hover:false});
*
*****************************************************/
var $= ......
正则
<script>
function checkvalue(){
if(document.Form.content.value.replace(/\s/g,"")=="")
{
alert("内容不能为空!");
document.addForm.content.focus();
return false;
}
document.addForm.submit();
return ......
js验证表单大全
1. 长度限制
<script>
function test()
{
if(document.a.b.value.length>50)
{
alert("不能超过50个字符!");
document.a.b.focus();
return false;
}
}
</script>
<form name=a onsubmit="return test()">
<textarea name="b" cols="40" wrap="VIRTUAL" rows="6"&g ......
事件源对象
event.srcElement.tagName
event.srcElement.type
捕获释放
event.srcElement.setCapture();
event.srcElement.releaseCapture();
事件按键
event.keyCode
event.shiftKey
event.altKey
event.ctrlKey
事件返回值
event ......