2 newbie questions

Discussion in 'Javascript' started by JimO, Nov 27, 2004.

  1. JimO

    JimO Guest

    Two questions:
    1) Is there a way to keep someone from viewing the source code of a page?

    2) Is there a way to keep someone from copying content from a page?

    Thanks,
    Jim
    JimO, Nov 27, 2004
    #1
    1. Advertising

  2. JimO

    Randy Webb Guest

    JimO wrote:

    > Two questions:
    > 1) Is there a way to keep someone from viewing the source code of a page?


    No.

    > 2) Is there a way to keep someone from copying content from a page?


    No.

    > Thanks,


    Welcome.

    --
    Randy
    comp.lang.javascript FAQ - http://jibbering.com/faq
    Randy Webb, Nov 27, 2004
    #2
    1. Advertising

  3. JimO

    Philip Guest

    In JavaScript, no to both questions.
    The problem is that the code is client-side, and so has to be
    downloaded with the HTML and then interpreted.

    In any server-side language the code will be hidden, like ASP, Perl
    etc...

    You can't stop the viewer doing a 'View Source'. To be quite honest
    looking at other people's code and seeing how they do things is quite
    instructive, so perhaps we can all be pleased that we can see other
    people's code; but, if only they couldn't see mine, that would be a
    good addition to any browser!


    "JimO" <joneill517###NOSPAM###@earthlink.net> wrote in message news:<8tUpd.4736$>...
    > Two questions:
    > 1) Is there a way to keep someone from viewing the source code of a page?
    >
    > 2) Is there a way to keep someone from copying content from a page?
    >
    > Thanks,
    > Jim
    Philip, Nov 27, 2004
    #3
  4. JimO

    RobG Guest

    koethler wrote:
    > You can disable the right mouse button this way ...


    How does disabling the right mouse button using JavaScript have anything
    to do with either of the OP's question?

    Disabling the right button does not stop me either viewing the source
    or copying the content. Sometimes the mouse I use does not even have
    a right button.

    --
    Rob
    RobG, Dec 3, 2004
    #4
  5. JimO

    Ivo Guest

    "koethler" wrote
    > You can disable the right mouse button this way by putting the

    <snip>
    > Hope this has been helpfull.


    Quite the opposite. Encouraging people to remove a very fundamental tool,
    the contextmenu, from the browser is counter-productive for a number of
    reasons. You have no idea how basic and important it is for some people.
    Besides, everything that can be done from the contextmenu, can also be done
    in some other way, so disabling it merely makes it more cumbersome to do it.
    You also didn't cancel the Shift + F10 shortcut key.

    Here is a bookmarklet to re-enable the contextmenu on any page that suffers
    from an anti-right-click-script, even in frames:

    javascript:(function(w){for(var%20i=0;i<w.length;i++){arguments.callee(w.fra
    mes);}try{function%20n(r){r.onclick=r.oncontextmenu=r.onmousedown=r.onmou
    seup=null;}n(w.document);n(w.document.body);}catch(e){alert('Bookmarklet%20f
    ailed:\n\n'+e.message);}})(top);
    --
    Ivo
    http://4umi.com/web/bookmarklet/rightclick.htm
    Ivo, Dec 14, 2004
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ali Syed
    Replies:
    3
    Views:
    552
    Mark McIntyre
    Oct 13, 2004
  2. pkirk25
    Replies:
    50
    Views:
    1,113
    Bill Pursell
    Oct 4, 2006
  3. Replies:
    10
    Views:
    548
  4. JohnE

    newbie with newbie questions

    JohnE, Aug 17, 2009, in forum: ASP .Net
    Replies:
    3
    Views:
    495
    Gregory A. Beamer
    Aug 17, 2009
  5. Vijay
    Replies:
    2
    Views:
    583
    Öö Tiib
    May 7, 2010
Loading...

Share This Page