1. 禁用右键点击(Disable right-click)
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="js/jquery.min.js"> </script>
</head>
<body>
<div>div</div>
</body>
<script type="text/javascript">
// $(function(){
// $(document).bind("contextmenu",function(e){//bind 为绑定参数
// return false;
// });
// });
$("div").contextmenu(function(){
alert("pk"); //点击右键触发事件
return false;//取消默认行为
});
</script>
</html>
2.新窗口打开
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="js/jquery.min.js"> </script>
</head>
<body>
<a href="http://blog.csdn.net/zhaoyazhi2129/article/details/8183793">ok</a>
</body>
<script type="text/javascript">
$("a").attr("target","_blank")
</script>
</html>