These three types of files have different syntaxes for creating comments that are ignored by the browser, but visible to anyone reading your code. In an HTML page, your notice might look like this:
// Copyright 2005, example.com. All Rights Reserved.
// We will take legal action against those who copy our HTML content,
Also, obfuscation comes at a price: obfuscated source code that others can't read isn't legible to you either. So you will have to keep a "pretty" version of your page for your private use in updating the page, and run the obfuscation program every time you make a change to your page.
But that's not the worst part: a ferociously obfuscated web page cannot be indexed correctly by search engines. In case you're not already clear on how important that is, it means that no one can find your website. And that's not an acceptable price to pay to protect your HTML code.
There is, however, one compromise technique that doesn't break search engines: removing newlines and unnecessary whitespace. Removing carriage returns so that the entire page becomes a single line is enough to frustrate casual thieves.
When removing carriage returns, bear these rules in mind:
2. If you use the <pre> element in your HTML, be aware that removing carriage returns within <pre> will alter the appearance of your page, turning all of the content of <pre> into one line from the web browser user's point of view.
3. Carriage returns inside <textarea> are also significant.
Got a LiveJournal account? Keep up with the latest articles in this FAQ by adding our syndicated feed to your friends list!