Home > Web Front-end > JS Tutorial > body text

javascript 禁止复制网页_javascript技巧

WBOY
Release: 2016-05-16 18:51:41
Original
1248 people have browsed it
1、使右键和复制失效
方法1:
在网页中加入以下代码:

方法2:
在中加入以下代码:



实质上,方法2与方法1是一样的。
方法3:
如果只限制复制,可以在加入以下代码:


2、使菜单"文件"-"另存为"失效
如果只是禁止了右键和选择复制,别人还可以通过浏览器菜单中的"文件"-"另存为"拷贝文件。为了使拷贝失效,可以在与之间加入以下代码:

这样,用户在另存网页时,就会出现"无法保存Web页"的错误。
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!