Enjoy an ad free experience by logging in. Not a member yet? Register.
|
|
Results 1 to 7 of 7
-
03-30-2016, 04:06 AM #1Regular Coder
- Join Date
- Sep 2012
- Posts
- 160
- Thanks
- 42
- Thanked 0 Times in 0 Posts
Can I Use Javascript to Achieve This?
...
Hi Folks!
I want every time anyone tries to copy or download content from my website, an alert box appears warning, "The contents of this website are copyrighted. Unauthorized use is strictly prohibited." I am thinking Javascript can accomplish that because all I need is a function that detects copying and downloading, and then adding an "if" statement to display an alert box bearing the warning message. My limitation is that I know not which and where to get such a function. Please help, thank you.
Thuita.
...
-
03-30-2016, 06:02 AM #2Master Coder
- Join Date
- Sep 2005
- Location
- Sydney, Australia
- Posts
- 8,055
- Thanks
- 2
- Thanked 808 Times in 797 Posts
HTML can accomplish that without any need for JavaScript. Your visitors will have already downloaded the page before they see anything at all.
Stephen
Learn Modern JavaScript - http://javascriptexample.net/
Helping others to solve their computer problem at http://www.felgall.com/
Don't forget to start your JavaScript code with"use strict";which makes it easier to find errors in your code.
-
03-30-2016, 07:51 AM #3Regular Coder
- Join Date
- Sep 2012
- Posts
- 160
- Thanks
- 42
- Thanked 0 Times in 0 Posts
...
Thank you felgall for the response. Am afraid I don't know how to achieve that with HTML. Please guide me; thank you.
...
-
03-30-2016, 08:21 AM #4Regular Coder
- Join Date
- Feb 2016
- Location
- Keene, NH
- Posts
- 311
- Thanks
- 0
- Thanked 42 Times in 40 Posts
I believe Felgall was being sarcastic.
You can put a message warning about it in your HTML, but there's not a blasted thing you can do to ACTUALLY stop or even intercept any attempt to save the page or copies of it's content. By it's very nature HTML and web content is in fact insecure as the user MUST download it in order for the browser to show ANY of it. The copy already exists before you're scripting would even RUN!
... much less anything you did in scripting can easily be slapped aside by disabling scripting or layering user javascript atop it using something like greasemonkey.
Hence why when people ask me "How do I stop people from downloading/copying my content" the ONLY advice I can give is "don't put it online in the first place!"From time to time the accessibility of websites must be refreshed with the blood of designers and owners; it is its natural manure.
http://www.cutcodedown.com
-
Users who have thanked deathshadow for this post:
Thuita Maina (03-31-2016)
-
03-30-2016, 05:36 PM #5Regular Coder
- Join Date
- Sep 2012
- Posts
- 160
- Thanks
- 42
- Thanked 0 Times in 0 Posts
...
Thank you deathshadow for the response. Actually, my aim is just to warn people but not to stop them from copying or downloading. But the warning should appear only when they attempt to copy or download. How can I do that with HTML?
...
-
03-30-2016, 08:55 PM #6Master Coder
- Join Date
- Sep 2005
- Location
- Sydney, Australia
- Posts
- 8,055
- Thanks
- 2
- Thanked 808 Times in 797 Posts
No you can't do that at all - they have to download the HTML BEFORE they can see anything you display via HTML. For them to get the warning before they attempt to download anything you need to transmit it telepathically before they finish clicking on any link to your site or before they finish typing your domain name in their address bar.
The web works by first downloading all the files a web page uses and only then displaying them in the browser. By the time they can see the HTML they already have a copy of all your files.Stephen
Learn Modern JavaScript - http://javascriptexample.net/
Helping others to solve their computer problem at http://www.felgall.com/
Don't forget to start your JavaScript code with"use strict";which makes it easier to find errors in your code.
-
Users who have thanked felgall for this post:
Thuita Maina (03-31-2016)
-
04-06-2016, 06:50 AM #7New to the CF scene
- Join Date
- Mar 2016
- Posts
- 5
- Thanks
- 0
- Thanked 1 Time in 1 Post
HTML and web content is in fact insecure as the user MUST download it in order for the browser to show ANY of it. The copy already exists before you're scripting would even RUN!
-
Users who have thanked StrawberryF for this post:
Thuita Maina (04-07-2016)



Reply With Quote
