Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Hideing index.html and CSS Sheets w/ Javascript?

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #38742
    dman777
    Member

    I was on the http://www.thecodeplayer.com and I tried to view it’s web documents and CSS sheets. I could not and I suspect Javascript was able to hide these. I was wondering, is there a way to hide your web documents and keep the code from being viewed with javascript?

    #105285
    Senff
    Participant

    I had no problems viewing the source code or CSS for that site (perhaps you meant a specific section?), but to answer your question — it’s possible to disable right-clicking with Javascript (so the “View Source” or “Inspect Element” options are not directly available), however I would advise against that.

    First, you’re taking away a default browser functionality from the user. I believe that’s something you should never do.
    Second, even if you do, a user can simply disable Javascript and bypass it anyway. If someone wants the source code, they can get it one way or another. Even by selecting “View Source” from the top menu.

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.