1. oncontextmenu="window.event.returnValue=false" 将彻底屏蔽鼠标右键特效
<table border oncontextmenu=return(false)><td>no</table> 可用于Table
2. <body onselectstart="return false"> 取消选取、防止复制 javascript技巧
3. onpaste="return false" 不准粘贴技巧
4. oncopy="return false;" oncut="return false;" 防止复制的javascirpt特效
5.<noscript>// 禁止另存为
<iframe src="*.htm"></iframe>
</noscript>
功能:禁止右键、禁选择、禁粘贴、禁shift、禁ctrl、禁alt
<script language="JavaScript">
<!--
function key(){
//禁止Shift
if(event.shiftKey){
window.close();
}
//禁止Alt
if(event.altKey){
window.close();
}
//禁止Ctrl
if(event.ctrlKey){
window.close();
}
return false;
}
document.onkeydown=key;
if (window.Event)
document.captureEvents(Event.MOUSEUP);
function nocontextmenu(){
event.cancelBubble = true
event.returnValue = false;
return false;
}
function norightclick(e){
if (window.Event){
if (e.which == 2 || e.which == 3)
return false;
}
else
if (event.button == 2 || event.button == 3){
event.cancelBubble = true
event.returnValue = false;
return false;
}
}
//禁右键
document.oncontextmenu = nocontextmenu; // for IE5+
document.onmousedown = norightclick; // for all others
//-->
</script>
<body onselectstart="return false"; onpaste="return false";>
在JSP标准的语法中,如果pageEncoding属性存在,那么JSP页面的字符编码方式就由pageEncoding决定,否则就由contentType属性中的charset决定,如果charset也不存在,JSP页面的字符编码方式就采用默认的ISO-8859-1。
//添加到收藏夹
function AddToFavorite()
{
if (document.all){
window.external.addFavorite(document.URL,document.title);
}else if (window.sidebar){
window.sidebar.addPanel(document.title, document.URL, "");
}
}
//设为首页
function setHomepage(){
if (document.all){
document.body.style.behavior='url(#default#homepage)';
document.body.setHomePage(document.URL);
}else if (window.sidebar){
if(window.netscape){
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
}catch (e){
alert( "该操作被浏览器拒绝,如果想启用该功能,请在地址栏内输入 about:config,然后将项 signed.applets.codebase_principal_support 值该为true" );
}
}
var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components. interfaces.nsIPrefBranch);
prefs.setCharPref('browser.startup.homepage',document.URL);
}
}