通过保存网页来限制用户 [英] Restrict user by saving webpage

查看:72
本文介绍了通过保存网页来限制用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨。

我想通过保存网页来限制用户(通过按Ctrl + S)我使用了下面的javascript代码。



Hi.
I want to restrict user by saving web page(by pressing Ctrl + S) I have used below javascript code for same.

$(window).bind('keydown', 'ctrl+s', function () {
      $('#save').click(); return false;
  });



此功能适用于浏览器,但它在Mozilla& Chrome,On Mozilla& Chrome浏览器, 用户可以保存网页(通过键盘上的Ctrl + S)将鼠标光标保持在地址栏上 。如何通过保存网页来限制用户?



[注意:已添加代码以通过使用菜单栏保存网页来限制用户contextmenu]


This functionality works fine for ie browser but it has some issue in Mozilla & chrome , On Mozilla & chrome web browser , user can save web page(by Ctrl + S from keyboard) keeping mouse cursor on address bar. How can I restrict user by saving web page?

[Note : already added code to restrict user by saving webpage using menubar & contextmenu]

推荐答案

window )。bind(' keydown'' ctrl + s' function (){
(window).bind('keydown', 'ctrl+s', function () {


' #save')。click(); return false ;
});
('#save').click(); return false; });



此功能适用于浏览器,但它在Mozilla& Chrome,On Mozilla& Chrome浏览器, 用户可以保存网页(通过键盘上的Ctrl + S)将鼠标光标保持在地址栏上 。如何通过保存网页来限制用户?



[注意:已添加代码以通过使用菜单栏保存网页来限制用户contextmenu]


This functionality works fine for ie browser but it has some issue in Mozilla & chrome , On Mozilla & chrome web browser , user can save web page(by Ctrl + S from keyboard) keeping mouse cursor on address bar. How can I restrict user by saving web page?

[Note : already added code to restrict user by saving webpage using menubar & contextmenu]


我不知道限制用户从地址栏保存页面。

您的代码适用于网页。

<如果用户右键点击你的页面并点击另存为......

用于该用途,那么
i会发现一些小错误。

/>
i dont know about restricting user to save page from address bar.
your code works perfectly for webpage.

i have found little bug.
what if user right click on your page and click on save as..
for that use :-
<body oncontextmenu="return(false);">



据我所知: -

你不能阻止你的网站被下载,因为这是每个用户的浏览器正在做的事情来显示它。

另一种选择是试图让它更难或烦人让他们下载它,通过使用JavaScript来改变鼠标按钮的行为。


$ I.您可以使用menu-> file->下载您的页面另存为..


as per my knowledge:-
you can't prevent your site from being downloaded, because that is what every user's browser is doing to display it.
The other option is to try and make it more difficult or annoying for them to download it, by using JavaScript to change the behavior of the mouse buttons.

in I.E. you can download your page using menu->file->save as..


这篇关于通过保存网页来限制用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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