If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

You cannot stop people fromk viewing the HTML code that your web pages consist of. It's simply not possible. The entire, *unecrypted* HTML has to be sent to the browser in order for it to render pages. Sure, there are numerous ways of making it more difficult for someone to do this, like disabling right-clicking (although this really annoys me because I often use right clicking to navigate, copy/paste etc.), but at the end of the day you're going to have to accept that people will always be able to see the HTML if they want to.

There were rumours of a product that would encrypt your HTML code when it sent it to the browser, but such a technique would require every visitor to your site to have a special plugin, so it's almost useless (the encryption would have to be two way as well so that the browser could decrypt and render the HTML properly, and I imagine that someone would come along quite quickly and write a program to do this anyway). If someone really wants to see your HTML code, they'll just make a standard GET request for it using a program such as telnet anyway.

Shouldn't this thread be in the web development forum, since it's mainly about HTML?

- Have some Javascript generate a string using a complicated algorithm, then document.write a script element to read in a further Javascript (named with the complicated algorithm string in) and that JS can write the HTML with document.write()

Ideally hash window.location.href into the algorithm so if someone nicks it it doesn't work

yeha there is some program the changes the code, and I've seen it done. I got a feeling that it changes the code to things like, %20 etc etc, it may seem quite pointless, but once you convert the whole thing, then you'll see why ... I was trying to read someone elses code, and it was truely annoying and difficult.
No plugins were required also, that'd be the best way I guess.

There is a program in the net somewhere which actually encrypts the html code. When you view the source, you only see cryptic letters and numbers.

Actually it doesn't encrypt it. It just changes the spaces and symbols to..hex i think? And it's not a program, it's a simple subsituting script. The site use to be http://www.codeseal.com but that doesn't work anymore. But guess what? For your convience i've attached the code seal page! Hope this ...helps someone out there...

BTW trevorf is right when he said it was truely annoying and difficult to read. But it is not impossible to steal the source. I'm sure myself or anyone else can come up with a program/script that would do the exact opposite of what this does. But it is good for kiddie sites i guess. Oh and one last thing, if your page is very content heavy, this will just add to the size of the page. Weigh in the advantages and disadvantages for yourselves.
Cheers!