Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jan 2006
    Posts
    243
    Thanks
    14
    Thanked 2 Times in 2 Posts

    highlight detection?

    Is there some way to detect if somebody tries to highlight text or in any other way tries to copy text?

    I'm writing a little game just for fun and this may come in handy.

    I'm also looking at other ways to make text visible but not copyable, like using it in a button or something similar, but some kind of highlight detection would be preferable so I can make some kind of response to such an event.

    Thanks

  • #2
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,618
    Thanks
    0
    Thanked 645 Times in 635 Posts
    You can make the actual text displayed in the web page unselectable provided that your visitors have their browsers configured to permit the necessary Javascript command to run. If they block that function then they can do what they want with your page content. They can of course bypass the block by accessing the page source in one of dozens of other ways anyway. The only way to make web page content unselectable to everyone is to use pdf instead of html and use the options within the save function of the full version of Adobe Acrobat to password protect the select text option.
    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.

  • #3
    Regular Coder
    Join Date
    Jan 2006
    Posts
    243
    Thanks
    14
    Thanked 2 Times in 2 Posts
    Thanks for the response, I'm now using an alert window to display the text.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •