Click to See Complete Forum and Search --> : time or use-limit right click script
starrwriter
02-16-2003, 08:04 PM
Since I'm a novice, here's a challenge for you javascript wizards. Can a script be written that would LIMIT right clicks by number of times or days rather than simply disabling right click? This is for HTML documents for which I want to prohibit copy/paste functions after a certain number of uses or days.
LAwebTek
02-16-2003, 09:41 PM
could easily be done with a cookie. Set a cookie that increments at each page view. Then retrieve the cookie, and if the value is = or > the allowance, have the script execute a disable right click script. If you want it to be based on say, only 5 clicks per day, just make sure the cookie expires after one day. If you need help writing the script post again, but I thought I'd provide the information only first in case you'd like to venture out and try to pull it off yourself.
LAwebTek
http://javaAMP.lawebtek.com
jdavia
02-16-2003, 10:15 PM
Originally posted by starrwriter
Can a script be written that would LIMIT right clicks by number of times or days rather than simply disabling right click?
If a script can be written, even if the script worked, You still cannot keep anyone from getting access to your code. I don't think you mean the Browser window itself. But either way the information can be had.
starrwriter
02-17-2003, 06:52 AM
Originally posted by LAwebTek
could easily be done with a cookie. Set a cookie that increments at each page view. Then retrieve the cookie, and if the value is = or > the allowance, have the script execute a disable right click script. If you want it to be based on say, only 5 clicks per day, just make sure the cookie expires after one day. If you need help writing the script post again, but I thought I'd provide the information only first in case you'd like to venture out and try to pull it off yourself.
LAwebTek
http://javaAMP.lawebtek.com
Thanks for the tip. I've never written a javascript from scratch, only configured existing ones to fit my needs, but I'll do some research on cookie scripts and see if I can find one to alter.
By the way, I am well aware that no script is fool-proof in preventing access to the elements of an HTML document. I only want to block the 90% who are not computer savvy.
jdavia
02-17-2003, 05:05 PM
The 90% that you block, don't know how to decipher the code for their use anyway.
The 10% that do, are being denied the right/click function for any other reason.
It is the 10% that will want to see how you did it, or copy something and convert for their use, if you think about it more. It is a function that is annoying to everyone except the page designer in my book.
LAwebTek
02-17-2003, 05:26 PM
Although I do see where it may be benefitial to point out some of the problems that may arise from using a script, I also believe that the main reason for the forum is to educate. Therefor you will learn more by doing then not. I'll leave it up to the developer's discression as to whether or not to use the script - my goal is simply to help you learn how its done. So as I said before, if you need help - just post.
something to consider - if you make the script I would recommend having right click open a small navigation menu that links to other pages on your site (if applicable). Some people (especially left-handed) will have the left click and right click buttons inversed. In this case, disabling right click entirely prevents any functionality. By causing a menu to pop up, the functionality will remain intact and will probably be seen as 'neat' rather than annoying.
jdavia
02-17-2003, 06:02 PM
Originally posted by LAwebTek
I also believe that the main reason for the forum is to educate. Therefor you will learn more by doing then not.
something to consider - if you make the script I would recommend having right click open a small navigation menu that links to other pages on your site (if applicable).
Good that is a good alternative. Can I do my homework now?
You get a menu, and hopefully a History link for Back and Forward for those of us that use the back button. (I seldom remember the page names I browse)
starrwriter
02-17-2003, 06:23 PM
[QUOTE]Originally posted by LAwebTek
[B]Although I do see where it may be benefitial to point out some of the problems that may arise from using a script, I also believe that the main reason for the forum is to educate. Therefor you will learn more by doing then not. I'll leave it up to the developer's discression as to whether or not to use the script - my goal is simply to help you learn how its done. So as I said before, if you need help - just post.
something to consider - if you make the script I would recommend having right click open a small navigation menu that links to other pages on your site (if applicable)
Not applicable. This isn't for a web site. It's for HTML documents to be viewed on a computer.
I found a script for a cookie that opened a new window on the first three viewings, substituted the right-click disable function for the window opening function, but couldn't figure out how to configure it to do the reverse: count 3 viewings, then disable right click. I would appreciate any help.
jdavia
02-18-2003, 12:04 AM
Originally posted by starrwriter
[QUOTE]Originally posted by LAwebTek
[B]Not applicable. This isn't for a web site. It's for HTML documents to be viewed on a computer.
I would appreciate any help.
If for only use on the computer, I found this. See if it will work for you.
Limit Others' Access To My Files and Directories
1.Double-click Network Neighborhood.
2.Navigate to the file or directory.
3.Right-click the file or directory and then click Properties.
4.To change access attributes of the file or directory, click General,
check the desired attributes, and then
click OK.