该程序是想“查看源文件”时,打开一个alert视窗,避免让用户看到source code; 可是运行不出来,错误出在哪里呢
<html>
<head>
<title>onmousedown 应用实例</title>
<script language=javascript1.1>
function right(e)
{
if(event.button==2)
{
alert("\ncopyright 2000 文魁信息 all rights reserved.");
}
document.onmousedown=right;
window.onmousedown=right;
}
</script>
</head>
<body>
<h1>
<a href="http://baidu.com">文魁信息有限公司</a>
</h1>
</body>
</html>
<html>
<head>
<title>onmousedown 应用实例</title>
<script language=javascript1.1>
function right(e)
{
if(event.button==2)
{
alert("\ncopyright 2000 文魁信息 all rights reserved.");
}
document.onmousedown=right;
window.onmousedown=right;
}
</script>
</head>
<body>
<h1>
<a href="http://baidu.com">文魁信息有限公司</a>
</h1>
</body>
</html>
解决方案 »
- js如何获取一个值之后判断是否执行另外一个js方法?
- highcharts中x轴的刻度的距离如何设置
- 十万火急:做的无缝滚动字幕,鼠标放上去要静止,如何实现
- js如何访问在函数体内动态创建的标签!!!
- 来请教js高手一个问题
- 正则高手请进,
- 点击网页按钮,如何实现刻录本机文件到光盘……急……
- 市联动的下拉表框,,谁有呀!!
- 怎么修改对象的事件,例如:页面上有两个按钮,我想点击一个,修改另外一个按钮的单击事件!
- 如果要做树型菜单,需要用到哪些javascript与dhtml的元素???
- 一个关于 js + css图片切换的问题 急求解答啊
- 我郁闷:火狐浏览器居然如此垃圾,在子DIV中居然不能显示“光标”,望各位前辈协助解决,提供建议,小生谢谢了!
<head>
<title>onmousedown 应用实例 </title>
<script language=javascript1.1>
document.oncontextmenu=function(){alert("\ncopyright 2000 文魁信息 all rights reserved."); return false}
</script>
</head>
<body>
<h1>
<a href="http://baidu.com">文魁信息有限公司 </a>
</h1>
</body>
</html>