Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I hide my HTML Source?

HTML: How To...

How can I hide my HTML Source?

by  ChrisHunt  Posted    (Edited  )

[red]YOU CAN'T![/red]

Next question please...

What? You want more?

OK, consider how the internet works: The browser gets an HTML file, maybe some CSS and/or Javascript files too, reads them and builds up a page as it's requested to do. The browser has to be able to read the source, because that's all it understands and that's the only way your page is going to get built properly.

It follows that there's no way that you can hide your source code from people, and still serve it up to browsers. Anybody who says that they can is selling snake oil. Sure you could use javascript to put some easily surmounted obstacles in the way of would-be source readers, but you won't stop any moderately competent person from doing it. In addition, some JS obfuscation methods will prove fatal to your search engine position - usually a pretty undesirable side effect.

Even if it were possible, it wouldn't be desirable. Consider again how the internet works, but at the human level this time. Designers and would-be designers have been able to look at eachothers code, copy and improve upon eachothers techniques, and build the internet we know and love. Does anybody think we'd have come so far in so little time if each little innovation was a jealously guarded trade secret?

So, love your "View Source" button. If people want to copy your amazing source (and, let's face it, it probably isn't and they probably won't) you're helping the progress of the human race. Who wouldn't want to do that?
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top