禁用在网站上复制 [英] Disable Copying on a website

查看:93
本文介绍了禁用在网站上复制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道挫败世界上最先进的思想是不可能的,但我想在我的网站上放置一些障碍,让学生不要复制文本,并将该文本作为答案发布。 (如果用手输入,那没关系。)

I know that it's impossible to thwart the world's most advanced minds, but I'd like to put the slightest of barriers on my website to keep my students from copying text from it and posting that text as their answer. (If they hand type it, that's ok).

由于浏览器的不一致性,我只是非常害怕JavaScript。

I'm just so afraid of JavaScript because of cross browser inconsistencies.

鉴于我已经加载了jQuery并且希望尽可能使用jQuery,我该怎么做:

Given that I have jQuery loaded and prefer to use jQuery whenever possible, how do I:


  1. 禁用Ctrl + c

  2. 禁用菜单编辑复制。


推荐答案

如果你有特定div的文本,你可以在这些div之上放置一个透明的div。其次,你可以使所有受保护的文本动态化,并将其注入到javascript中的div中,其中将以编码形式存在 - 这将打败'view-source'。

If you have your texts in particular divs, you could put a transparent div on top of those divs. Secondly, you could make all your protected text dynamic, and inject it into the divs from javascript where is would exist in a coded form -- that would defeat a 'view-source'.

这篇关于禁用在网站上复制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆