Berlin Wall Remnants Highway Robbery
Part of How Do They Do That With HTML? by Carl Tashian

This web page has taken hours of work in design and writing. And I'm essentially giving it away, along with a few photos and some other ramblings. That's OK with me, but a lot of people think their hard work will be ripped off, and they want to do something to protect it.

I hate to break it to you, but it's nearly impossible to protect information on the Internet. Once it's out there, it's out of your control. The music and movie industries are going bonkers because they don't make a penny on the massive proliferation of their products over the Internet. If a couple multi-billion dollar industries can't figure out how to protect their data, there's a good chance you won't be able to protect yours.

But you still want to publish something, right? You want to promote your polka band's new album, or you want to show the world your prize-winning photographs of empty parking lots. So here's the solution: Give people a taste of your work, but only enough to leave them wanting more. It's the crack dealer's approach to e-commerce.

The crack dealer's approach to selling music online:

In short, if you want to sell music on the Internet, you should follow the lead of the big online music retailers like CDNow. On their site, you can listen to samples of music at low quality, but you have to buy the CD if you want the real deal. It's called lossy audio compression because the music must be compressed to fit through someone's slow modem, and it sacrifices quality for instant playback. Retailers creatively distribute radio quality versions of a song to get people hooked, and then they sell CDs.

Of course, as soon as your polka band gets as big as Metallica, the game is over-- someone else will put your music on the Net in full CD quality whether you like it or not. Good thing polka music isn't that popular, eh?

There are a number of ways to distribute your music with lossy compression, but I recommend encoding it into MP3 format. It's easy, it's hip, and it can be done for free. Here are a few programs that will help:

For Windows: For Mac: For Linux: The crack dealer's approach to selling photography and visual art online:

The web is great for professional photographers and other artists to present their work without giving away too much. National Geographic Magazine has no qualms about publishing photos on the web, and neither should you. The truth is, computer screens are extremely low resolution compared to a piece of paper; if you print one of those beautiful 350 x 350 pixel National Geographic photographs at medium quality (300dpi) on your color printer, it will come out as a tiny 1.2 x 1.2" print. If you want to print a 4 x 6" photograph on your printer, you need an image that is at least 1000 x 1500 pixels. To get an idea of how big a 1000 x 1500 image looks on your monitor, click here (and be prepared to wait). As you can see, 4 x 6" on your monitor is not 4 x 6" on your printer.

Hopefully, this has convinced you that it's OK to distribute small versions of your work without worrying about theft. Now that you're ready to be a crack dealer, you'll need to take photos of your work (unless your work is already photographic) and prepare these photos for the web. It's time for you to read my Photo Preparation Guide.

Protecting your HTML and images from thieves:
(or: you can fool some people sometimes, but you can't fool all the people all the time)

You can put an alarm system in your house and a U-lock on your bicycle, but a clever thief will still find a way to steal your stuff. The problem with protecting HTML is, of course, that people have to get your HTML into their computer in order to see your web page. And once it's on their computer, they can do anything they want with it. There are one or two tricks to deter thieves (which I'll show below), but keep in mind that a clever person will have no problem getting what they want, no matter what you do!

In Internet Explorer, people typically use the right-click menu to view a page's source code or save an image. To prevent this, you can use JavaScript, bypass the right-click menu, and pop up a message saying, "Sorry, you can't steal this." Here's the code for it, which you can put anywhere in your web page:

<!-- Original:  Martin Webb ( -->
<!-- Put this code on your page to prevent most people from using the right-click menu. -->
<SCRIPT LANGUAGE="JavaScript1.1">
<!-- Begin
function right(e) {
if (navigator.appName == 'Netscape' && 
(e.which == 3 || e.which == 2))
return false;
else if (navigator.appName == 'Microsoft Internet Explorer' && 
(event.button == 2 || event.button == 3)) {
alert("Sorry, you do not have permission to right click.");
return false;
return true;

if (document.layers) window.captureEvents(Event.MOUSEDOWN);
if (document.layers) window.captureEvents(Event.MOUSEUP);
//  End -->
The catch is, anyone who knows how to turn off JavaScript in the Internet Options menu can grab your HTML source or images, no problemo.

Another common method is to tuck your HTML away in a JavaScript (.js) file. First, you must pull out all of the HTML in your web page and replace it with something like this:

<script language="JavaScript1.1" type="text/javascript" src="myscript.js"></script>

This asks the web browser to grab myscript.js and interpret it as a JavaScript program. In the myscript.js file, you write code that simply prints out your entire web page.

document.write('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">');
document.write('<head><title>Test Document</title></head>');
document.write('<body>Hello World.</body>');

It's a ridiculous and tedious solution, and it will only protect your HTML (not images), but it will make things more difficult for thieves. You can test it out if you wish.

There are other methods for deterring thieves from looking at HTML and images, but they're all based on the idea of "security through obscurity," which can't guarantee any security at all in the end. Is it really worth all the trouble? I don't think so.

[ return to front page ]

Reproduction of material from this page without written permission is strictly prohibited
Copyright © 1995-2001 Carl Tashian