标签:
var x = Math.floor(Math.random() * (max - min + 1)) + min;
window.onload = function() { if (location.href.indexOf(‘#reloaded‘) === -1) { location.href = location.href + "#reloaded"; location.reload(); } }
window.history.go(-1);
window.location.reload()
if ( img.complete ) { function() { // do something... }; } else { img.onload = function() { // do something... }; }
if (navigator.userAgent.indexOf(‘MSIE‘) > -1) { alert(‘你使用的是ie浏览器!‘) } // MSIE/Chrome/Firefox/Opera
// 屏蔽右键菜单 document.oncontextmenu = function() { return false; } // 禁止选取 document.onselectstart = function() { return false; } // 禁止复制 document.getElementsByTagName(‘body‘)[0].oncopy = function() { return false; } // 禁止剪切 <input type="text" oncut="return false":> //防止 // 禁止粘贴 <input type="text" onpaste="return false":> // 防止当前页面被别人导入iframe if (top.location !== self.location) { top.location = self.location; } // 判断当前页面是否有iframe if(window !== top) { console.log(‘当前页面有iframe‘); } // 判断当前页面的来源(从哪个页面打开或跳转来的) document.referrer
标签:
原文地址:http://www.cnblogs.com/happyfreelife/p/4248451.html