Home >Web Front-end >JS Tutorial >The classic trick to solve the problem that many websites cannot copy text_javascript skills

The classic trick to solve the problem that many websites cannot copy text_javascript skills

WBOY
WBOYOriginal
2016-05-16 19:21:591425browse

I often encounter many websites that use JS to lock web pages, so that users cannot select text or copy it. Here is a small method to copy the following line of code into the address bar of the browser. Enter. Haha
(reprinted from X2BLOG)

Copy code The code is as follows:
javascript:alert( document.onselectstart = document.oncontextmenu = document.onmousedown = document.onkeydown = function(){return true;});
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn