1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

script to unable people from copying your content or your html code

Discussion in 'JavaScript' started by badrovichxx, May 4, 2009.

  1. #1
    hi i want to share with you this code to avoid people who want to see your html code or to copy and paste your content with the wright boton of the mouse, put it between <head> and </head> or <body> </body>


    <script language="JavaScript1.2">
    function nosource()
    {
    alert('sorry copyright ...');
    return(false);
    }
    document.oncontextmenu = nosource;
    </script>
    SEMrush
     
    badrovichxx, May 4, 2009 IP
    SEMrush
  2. Ristaki

    Ristaki Peon

    Messages:
    31
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Ristaki, May 4, 2009 IP
  3. JavaScriptBank.com

    JavaScriptBank.com Peon

    Messages:
    141
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #3
    JavaScriptBank.com, May 4, 2009 IP
  4. camjohnson95

    camjohnson95 Active Member

    Messages:
    737
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    60
    #4
    I think that it is more useful for making it harder to download images from the site...
     
    camjohnson95, May 5, 2009 IP
  5. dimitar christoff

    dimitar christoff Active Member

    Messages:
    882
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    90
    #5
    protecting stuff from webpages is naive at best - to a determined person, its all too easy to steal whatever they need. the only thing worth wasting time over is encoding your php source code with something like ioncube so that other uses on the server cannot access it.

    as for html obfuscating, you can always save the rendered source of the html (webdev plugin in firefox)
    for images, there are plugins, but webdev plugin can also help here and list you all images from the DOM
    for js, you can use a packer like dean edwards' old one (relying on eval, even though it's not a recommended practice these days) - but using firebug you can view the eval'd code and steal the functions anyway

    if you post it on the internet, it stops being yours :/
     
    dimitar christoff, May 6, 2009 IP
  6. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #6
    Obfuscating stuff this way is completely useless. What it does is make it harder for casual users to use your page, determined people, or people who's geeky enough just find this mildly annoying. For casual users, breaking the right-click menu is horrible, and leads to thousands of question to the IT-department, which then have to "quelch the fire" - that there isn't anything wrong with the browser, just the person who's made the page.
     
    PoPSiCLe, May 6, 2009 IP
  7. Poor Boy

    Poor Boy Peon

    Messages:
    15
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    appreciate your code, but people always have a way to counter it :)
     
    Poor Boy, May 6, 2009 IP
  8. mxyzplk

    mxyzplk Active Member

    Messages:
    792
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    85
    #8
    well at least he tries, or maybe reduce someone to copy :p
     
    mxyzplk, May 6, 2009 IP