In the past articles, we have learned how to make dynamic webpage. But it isn’t enough. In this article we will learn some knowledge about HTML codes. HTML is short for Hyper Text Markup Language. The extended name of the document created by HTML codes is .html or .htm. In the dreamweaver8.0, even you aren’t familiar with HTML codes; you still can make web pages. However, the most advantages just are the most disadvantages. There will be a lot of useless codes created by the way, which will reduce the speed of loading the web pages. In many case, we need to adjust the HTML codes by ourselves to achieve some special effect. Now we will learn some things about HTML codes.
Sometimes, maybe you don’t want to let others copy the content in you web pages. In this case, you need the help of HTML codes. Now let us learn how to forbid the viewers to copy the content. It is very easy. Just need some HTML codes.
Step1:
Open a web page you have built. Show code view and add the following codes in to the section between <head> and <head>.
- <script language=javascript>
- function click() { // Here we definite the forbidding left-click function.
- alert(’No Copy ‘) } // Here no copy is the content of the alert message box.
- function click1() { // Here we definite the forbidding right-click function.
- if (event.button==2) {
- alert(’No Right Click!’)
- }
- } // Here No Right Click! is the content of the alert message box.
- function CtrlKeyDown(){ // Here we definite the forbidding of Ctrl key down.
- if (event.ctrlKey) {
- alert(’improper copy will damage your system ‘)
- }
- }
- document.onkeydown=CtrlKeyDown;
- document.onselectstart=click;
- document.onmousedown=click1;
- </script>
Step2:
Save the web page. Preview in the explorer. When you click mouse to copy the content, you will see a message box appearing, alerting that you can’t copy.
Now you have successfully forbidden the viewers to copy your content. You can see that this effect can’t be achieved just by depending on the ordinary edit. Some special effect like that can only be achieved by using codes. So it is very necessary to learn about the HTML codes.


sorry, but this is nonsense, you’ve not ’successfully forbidden the viewers to copy your content.’, you’ve just disabled the right click with javascript, the viewer can still copy your content with cut&paste, screengrabs, by viewing the html, using a site downloader, or simply by disabling javascript.
Also, you’re not using ‘the HTML codes’, you’re using Javascript.