javascript获取浏览器的宽度和高度
<script language="JavaScript" type="text/JavaScript">
<!--
function displayScreenSize()
{
var bodyWidth =document.body.clientWidth; //网页可见区域宽
var bodyHeight =document.body.clientHeight; //网页可见区域高
var bodyWidthWithBorder =document.body.offsetWidth; //网页可见区域宽(包括边线的宽)
var bodyHeightWithBorder=document.body.offsetHeight; //网页可见区域高(包括边线的宽)
var bodyWidthWithScroll =document.body.scrollWidth; //网页正文全文宽
var bodyHeightWithScroll=document.body.scrollHeight; //网页正文全文高
var bodyTopHeight =document.body.scrollTop; //网页被卷去的上边距
var bodyLeftWidth =document.body.scrollLeft; //网页被卷去的左边距
相关文档:
1:取得表单中的TextBox 中的数据:document.FormName.TextBox.value;
2: 控制元素的现实和隐藏:有visibility 和 display
区别:1)前者的属性值有,visible、hidden 。
后者的属性值有:block 和 none;
2)前者虽然隐 ......
//关闭,父窗口弹出对话框,子窗口直接关闭
this.Response.Write("<script language=javascript>window.close();");
//关闭,父窗口和子窗口都不弹出对话框,直接关闭
this.Response.Write("");
this.Response.Write("{top.opener =null;top.close();}");
this.Response.Write("");
//弹出窗口刷新当前页面width=20 ......
javascript修改IMG标签的SRC实现验证码时,IE正常,火狐和google出状况
1.当点击某一按钮的时候,把图片域中的图片改变一下
<img id="randimg" src="/servlet/CreateValidateNum" width="60" height="20" />
<span style="cursor:hand" onclick="reflush();return false; ......
replace()最简单的算是能力就是简单的字符替换。
示例代码如下:
<script language="javascript">
var strM = "javascript is a good script language";
//在此我想将字母a替换成字母A
alert(strM.replace("a","A"));
</script>
它只替换了首字母。但如 ......
scrollHeight: 获取对象的滚动高度。
scrollLeft:设置或获取位于对象左边界和窗口中目前可见内容的最左端之间的距离
scrollTop:设置或获取位于对象最顶端和窗口中可见内容的最顶端之间的距离
scrollWidth:获取对象的滚动宽度
offsetHeight:获取对象相对于版面或由父坐标 offsetParent 属性指定的父坐标的高度
offsetL ......