JavaScript 屏蔽右键
1、function vv()
{
if(event.button==2)
{
alert('防止服务器负担过大,右键功能被屏蔽!')
}
}
document.onmousedown=vv
2、document.oncontextmenu = new Function("return false;")
3、<body oncontextmenu="return false" >
相关文档:
自定义控件中的页面代码:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="wcontrol.ascx.cs" Inherits="wcontrol" %>
<script type ="text/javascript">
function PopupCalendar(InstanceName)
{
///Global Tag
this.instanceName=InstanceName;
///Properties
this.separator="-"
t ......
Several programming languages implement a sprintf function, to output a formatted string. It originated from the C programming language, printf function. Its a string manipulation function.
This is limited sprintf Javascript implementation. Function returns a string formatted by the usual printf co ......
这几天,我在读《Javascript语言精粹》。
这本书很薄,100多页,正好假日里翻翻。
该书的作者是Douglas Crockford,他是目前世界上最精通Javascript的人之一,也是Json格式的创造者。
他认为Javascript有很多糟粕。因为1995年Brendan Eich设计这种语言的时候,只用了三个月,很多语言特性没有经过深思熟虑,就推向了市 ......
<script>
var flags ;
if(window.XMLHttpRequest) {
XMLHttpReq = new XMLHttpRequest(); //firefox下执行此语句
}
else if(window.ActiveXObject) {
try{
XMLHttpReq = new Acti ......
Javascript的事件绑定主要有四种方法(一下在IE中运行正常,但不保证其他浏览器):
[注:onXXX为某一事件,fun为某一function,domId为某一DOM对象id,event类型见后边附录。]
1、在DOM中,直接用onXXX="fun();"进行绑定
2、在Javascript代码中用 DOM对象.onXXX=fun 进行绑定
3、用 DOM对象.attach ......