aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Hide HTML in Browser Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Hide HTML in Browser" Watch "Hide HTML in Browser" New topic
Author

Hide HTML in Browser

Jane Somerfield
Ranch Hand

Joined: Jul 20, 2002
Posts: 193
Is there a way in the HTML or HTTP to instruct the browser (IE, Netscape, Firefox)
not to display the source so the users can not view the HTML code of the page by
just clicking View -> Source in the browser?
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Nope

nothing you can do

Eric
Leandro Melo
Ranch Hand

Joined: Mar 27, 2004
Posts: 401
Hi.

Are you worried about others looking at your code? If yes, you can try to obfuscate it .


Leandro Melo
SCJP 1.4, SCWCD 1.4
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61064
    
  66

I mean really. Why bother?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Jane Somerfield
Ranch Hand

Joined: Jul 20, 2002
Posts: 193
Originally posted by Bear Bibeault:
I mean really. Why bother?


To protect my javascript.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61064
    
  66

If the browser can see it, the end user can. So your only bet is obfuscation.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
If you want to hide your JavaScript that is probably not even worth taking, you can use a packer http://dean.edwards.name/packer/ and select the shrink variables checkbox.

Eric
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Hide HTML in Browser