hide html code on my website

Discussion in 'JavaScript and AJAX' started by daabomb2002, May 5, 2007.

  1. daabomb2002

    daabomb2002 New Member

    Joined:
    May 5, 2007
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hi,

    I have a website www.linkdumptube.com and when i browse to it using IE and click on View source,it shows all my html code. Is there anyway to hide this?

    Thanks
     
  2. Darkness1337

    Darkness1337 New Member

    Joined:
    Mar 15, 2007
    Messages:
    130
    Likes Received:
    1
    Trophy Points:
    0
    I'm not really sure how to do that m8! but I know how to stop people right click on your page!

    if you wanna people stop people right click and steal your stuff just copy and paste this code! :)

    Code:
    [b]<script type="text/javascript">
    
    function ehan( evnt )
    {
      if( evnt.which == 3 )
      {
        alert( "No Right Click" );
        return false;
      }
      return true;
    }
    function ocmh()
    {
      alert( "No Right Click" );
      return false;
    }
    document.oncontextmenu = ocmh;
    document.captureEvents( Event.MOUSEDOWN );
    if( document.layers ) document.onmousedown = ehan;
    
    </script>[/B]
    I'll Try To Find It For Ya! :)
     
    Last edited by a moderator: May 9, 2007
  3. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    One of the most irritating thing I see when any site has blocked right click for couple of reasons.
    1. It does not allow me to open anything in new Window / Tab with my right click and I need to use the middle button.
    2. It does not hide the source and its always viewable through the view menu.

    Again disabling the JS is also an option
     
  4. Darkness1337

    Darkness1337 New Member

    Joined:
    Mar 15, 2007
    Messages:
    130
    Likes Received:
    1
    Trophy Points:
    0
    lol I know it's annoying but it'll protect your Images(if you dont want anyone to steal them) ... and yeah there is always a way to get around them....... lol

    I spent hours trying to find this thing but failed, well I'll find how to do it 2moz when I go to college!, n i'll tell ya how to do it (If I can find it)! :) lol
     
  5. Darkness1337

    Darkness1337 New Member

    Joined:
    Mar 15, 2007
    Messages:
    130
    Likes Received:
    1
    Trophy Points:
    0
    ah am sorry to say this, but I didn't manage to get the code for u. My tutor said there is a way to do it but she didn't know what the code is......... :(
     
  6. DaWei

    DaWei New Member

    Joined:
    Dec 6, 2006
    Messages:
    835
    Likes Received:
    5
    Trophy Points:
    0
    Occupation:
    Semi-retired EE
    Location:
    Texan now in Central NY
    Home Page:
    http://www.daweidesigns.com
    You cannot hide your HTML other than by not giving it to the browser in the first place. You can 'hide' your javascript by having it in an external file. However, you cannot prevent the user from getting at that file. If it's accessible to the browser, it's accessible.

    I don't know why anyone would want to annoy the user by disabling right-click. You can't prevent the user from getting anything that appears on the page. If the browser can get it, the user can get it. That's the nature of the beast.
     
  7. Darkness1337

    Darkness1337 New Member

    Joined:
    Mar 15, 2007
    Messages:
    130
    Likes Received:
    1
    Trophy Points:
    0
    I agree wiv ya, there is no point hiding it but there IS a way to do it and I wanna know how to do it lol cuz its just in my head na.....

    and yeah disbling the right click may annoy the user but.. but... but .... hmmmm lol
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice