西格网络科技有限公司 >> 行业资讯 >> 神奇代码解决网页复制问题
神奇代码解决网页复制问题 10-08-18
从事网站建设的朋友在写程序语言的时候,对下面我发的一段代码应该并不陌生。可是对于非专业人士,在浏览网页的时候,可能会在摘抄利用到网上的文字的时候碰到这个问题:网页页面文章不能复制!如何处理这个问题呢?这就是我要说的下面的话题了。利用神奇代码。
javascript:alert(document.onselectstart = document.oncontextmenu = document.onmousedown = document.onkeydown = function(){return true;})
今天Sun分享了他对文字复制上的小技巧,就是此代码复制到网页框中,回车,即可清除原格式,
javascript:alert(document.onselectstart = document.oncontextmenu = document.onmousedown = document.onkeydown = function(){return true;})
很好的方法。真比起IE安全修复,简单多了。


