JavaScript 屏蔽右键
1、function vv()
{
if(event.button==2)
{
alert('防止服务器负担过大,右键功能被屏蔽!')
}
}
document.onmousedown=vv
2、document.oncontextmenu = new Function("return false;")
3、<body oncontextmenu="return false" >
相关文档:
scrollHeight: 获取对象的滚动高度。
scrollLeft:设置或获取位于对象左边界和窗口中目前可见内容的最左端之间的距离
scrollTop:设置或获取位于对象最顶端和窗口中可见内容的最顶端之间的距离
scrollWidth:获取对象的滚动宽度
offsetHeight:获取对象相对于版面或由父坐标 offsetParent 属性指定的父坐标的高度
offsetL ......
<html>
<body>
<script type="text/JScript">
for (i=0; i<10000; i++) { // this loop enforces the effect
var model = new Object();
var element = document.createElement("<br>");
model.myElement = ......
用Javascript可以实现对GridView中某一行选择,而无需进行页面的刷新。
首先要在GridView的onrowdatabound的event handler中为GridView中的每一行onclick绑定event handler (Javascript)。假如GridView代码如下:
<asp:GridView runat="server" id="GridViewCategory" Aut ......
Javascript的继承可以通过call、apply、prototype实现。
1、call:在子类中,用父类.call(this,arg0,arg1...)可以继承父类。注意call的位置,尽量在子类的第一行(js按顺序执行,放在后面可能对子类的其他属性、方法有影响。比如子类和父类有相同名字的方法,后面的覆盖前面的)。
<html>
<head>
<t ......
下面都是个人理解以及查找的网上的资料,如有不对的地方请指正
This
this 始终指向调用它的对象 ,都没有对象调用时就指向window
另外就是this一般都是在function中,当不在function中的时候 一定是指向window的.
var a ='a';
alert(this.a); //出来的是a
alert(this.b); //undefined 因为还没定义 ......