Disabling right-click on your webpage
On May 30,2022 by Tom RoutleyA simple JavaScript code has been developed to help protect various sources that have been utilised on a designed webpage. All that one needs to do is incorporate the JavaScript code within the head of the HTML document. This code facilitates in disabling the option of right-click on a self designed webpage. For the function 'disableselect (e)' false value is returned and for 'reEnable' true value is returned. In the sub-function of IE4+, a false value is returned for selecting start and context menu within the document. For the sub-function of NS6, fulfilling Windows sidebar option, 'disableselect' function is activated on mouse down and 'reEnable' on mouse click. Finally, closing of copyright option is necessary despite disabling the right-click option for securing the contents of a webpage.
Often while trying to save some text or pictures from a website, you might wonder why your right-click is not allowed. This is the result of a simple JavaScript code that has been inserted into the website document to prevent copyright infringement issues, or to protect the source of your pictures. If you want to activate this option on your own website, here is a little tutorial on how you can do so, using JavaScript codes.
Note:
You should insert the following code in the head of your HTML document, between the
tags.You should however note that this procedure is not idiot proof. There are several ways a user can still copy the contents on your website. If they decide to disable the JavaScript on their web browser, they will be able to access your contents, with or without the right-click. Hence, I would strongly suggest you edit the copyright close on your pictures as well as your contents.
Article Recommendations
Latest articles
Popular Articles
Archives
- November 2024
- October 2024
- September 2024
- August 2024
- July 2024
- June 2024
- May 2024
- April 2024
- March 2024
- February 2024
- January 2024
- December 2023
- November 2023
- October 2023
- September 2023
- August 2023
- July 2023
- June 2023
- May 2023
- April 2023
- March 2023
- February 2023
- January 2023
- December 2022
- November 2022
- October 2022
- September 2022
- August 2022
- July 2022
- June 2022
- May 2022
- April 2022
- March 2022
- February 2022
- January 2022
- December 2021
- November 2021
- October 2021
- September 2021
- August 2021
- July 2021
- January 2021
Leave a Reply