Meaningless Drivel is fun!*
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 Murach's Java Servlets and JSP this week in the Servlets 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: 60765
    
  65

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: 60765
    
  65

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
 
Don't get me started about those stupid light bulbs.
 
subject: Hide HTML in Browser
 
Similar Threads
c:out
Data Alignment
Retrieve Form Values - null form values returned
JSP behaving badly!
displaying spaces in JSP