Advanced Search

Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: The No select text script

  1. #1
    Join Date
    May 2005
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default The No select text script

    Hi

    Abouth the No select text script
    Link

    I have testet the script and I can see that text surrounded by the < p > < /p> tag isn't protectet by the script in firefox v 1.0.4.

    On this page

    I can select all the text where you have use the <p> tag.

    Is there any way to fix this

    Hope there is an solution

    Your webside rocks
    Last edited by dragonbook; 06-09-2005 at 08:53 PM.

  2. #2
    Join Date
    Aug 2004
    Location
    Brighton
    Posts
    1,563
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi-

    All scripts nowadays have lost the ability to disable browser functions with complete success - right-click scripts, etc.

    And if anyone wants your text, they can easily view your source code and get it from there, or any other number of places.

    cr3
    A retired member, drop me a line through my site if you'd like to find me!
    cr3ative media | read the stickies

  3. #3
    Join Date
    May 2005
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Hi

    Yes thats true, but I'm not using the script to protect my text....

    I have at game seletion on my page, and when some of the games are played it is very annoying if the text and picturs in the game are selectet

    another thing is that when you try to select the tekst on this page you can do it whith no problem in Firefox !!!!! So it makes me wonder why the text says that the script works in both IE5+ and FF1+

    Cause it doesn't worke in FF1+.

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,686
    Thanks
    43
    Thanked 3,128 Times in 3,094 Posts
    Blog Entries
    12

    Default

    You're right, it doesn't work. But, it does work on some things on the page and on a demo I set up here. Try it with your page and see, might do the trick.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    May 2005
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I have tried the script on my page, thats how I came to the conclusion that the script don't work in FF..

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,686
    Thanks
    43
    Thanked 3,128 Times in 3,094 Posts
    Blog Entries
    12

    Default

    Well, then I'd try the script without its built in selectivity. It is a short script:
    Code:
    <script type="text/javascript">
    
    /***********************************************
    * Disable select-text script- © Dynamic Drive (www.dynamicdrive.com)
    * This notice MUST stay intact for legal use
    * Visit http://www.dynamicdrive.com/ for full source code
    ***********************************************/
    
    //form tags to omit in NS6+:
    var omitformtags=["input", "textarea", "select"]
    
    omitformtags=omitformtags.join("|")
    
    function disableselect(e){
    if (omitformtags.indexOf(e.target.tagName.toLowerCase())==-1)
    return false
    }
    
    function reEnable(){
    return true
    }
    
    if (typeof document.onselectstart!="undefined")
    document.onselectstart=new Function ("return false")
    else{
    document.onmousedown=disableselect
    document.onmouseup=reEnable
    }
    
    </script>
    Just remove the red part. That is what is enabling paragrapgh selection (due to the 'p' in the word 'input'). If you have no content on your page which requires exceptions, this should do nicely. If you do have content which requires exceptions be more specific, ex:

    Code:
    <script type="text/javascript">
    
    /***********************************************
    * Disable select-text script- © Dynamic Drive (www.dynamicdrive.com)
    * This notice MUST stay intact for legal use
    * Visit http://www.dynamicdrive.com/ for full source code
    ***********************************************/
    
    //form tags to omit in NS6+:
    var omitformtags=["input", "textarea", "select"]
    
    omitformtags=omitformtags.join("|")
    
    function disableselect(e){
    if (e.target.className.toLowerCase()!=='exempt')
    return false
    }
    
    function reEnable(){
    return true
    }
    
    if (typeof document.onselectstart!="undefined")
    document.onselectstart=new Function ("return false")
    else{
    document.onmousedown=disableselect
    document.onmouseup=reEnable
    }
    
    </script>
    to exempt only elements with the class name 'exempt'.
    Last edited by jscheuer1; 06-10-2005 at 07:04 PM.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  7. #7
    Join Date
    May 2005
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up Thanks jscheuer1

    I don’t know why… but I haven’t seen your last post before now It works perfect now THANKS.

  8. #8
    Join Date
    May 2005
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question

    Quote Originally Posted by jscheuer1
    to exempt only elements with the class name 'exempt'.
    I have tried to use your exempt class name like this

    <DIV class="exempt">You can mark</DIV>

    But I can't mark this text.

    Any idear why

  9. #9
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,686
    Thanks
    43
    Thanked 3,128 Times in 3,094 Posts
    Blog Entries
    12

    Default

    That is only for Mozilla based browsers, it will not work in IE.

    Here is a version of the script that omits tags properly in both browsers:

    http://www.dynamicdrive.com/forums/s...51&postcount=2
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  10. #10
    Join Date
    May 2005
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Okay thanks...

    Is it possible to use something like <DIV class="exempt">You can mark</DIV> around some text I don't want the script to protect ?

    While the protected page is loading it is still possible to mark text...... not at big deal but a little strange. Any way to fix this.

Bookmarks

Posting Permissions

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