2/12/11

Writing HTML Code on your Article

Hi. This is a very simple tips but it's very usefull to apply. Well, if you have a blog about computer/ internet like mine, you must be ever write an article that enclosed a HTML or JavaScript code. But, unfortunately when you post it, your written code doesnt appear as you want. Oppositely, it appears as a gadget/ preview that has been translated to HTML language. Don't worry, because here I will give you a nice trick to avoid it. Here they are...
write html code article post

For example, you want to make an article titled "How to Add Clock Gadget on Blog". Then, of course in your article, you'll enclose the HTML/ JavaScript code that should be copied by your reader. But, when you agree to publish it, you'll see that your code has changed into the real gadget (in here is clock gadget). So, the reader won't be able to follow your tips, isnt it..??

This simple thing should be mentioned by some blogger. Because of that, here i have some trick to enabling visitor's HTML copy-paste. They are:


1. Using http://centricle.com/tools/html-entities/
write html code article post
This site can change (encode) your HTML code into other code that can be appeared as text in your post.

Firstly, go to
http://centricle.com/tools/html-entities/
Then, you'll get the following preview:
write html code article post

In there, copy and paste your HTML code into the field. Then, click Encode.
After that, copy and paste the code into your post. Finished.

2. Using text area.
http://t0.gstatic.com/images?q=tbn:ANd9GcSmofj_bvDksmGV_u7BzSe_mlxj9QR-EYQQrNt8vQ1P0lfgvBAsD-eoacLA
Text area is used for putting some text, include HTML code, so that it will be in different place and will be able to be copied by your article readers.
To make Text Area is very easy. Just copy and paste the following code:


<div><form name="copy"><div align="center"><input onclick="javascript:this.form.txt.focus();this.form.txt.select();" type="button" value="Highlight All"> </div><div align="center"></div><p align="center"><textarea style="WIDTH: 300px; HEIGHT: 144px" name="txt" rows="100" wrap="VIRTUAL" cols="55">YOUR_HTML_CODE</textarea></p></div></form>

Then, change the text: YOUR_HTML_CODE , with your HTML code.
To change the width and height, just set the number on: "WIDTH: 300px; HEIGHT: 144px"

Then, publish your post.


Finally, just try one of the trick above. I have used those way to show HTML code in my article and it works. :)

P.S: If you have another better way, please give some comments below.

AND...NOW, I KNOW...!!!


(c) Written by: Nanda Firsta
Source: Own Experience

5 comments:

your comment will be very usefull and helpfull for me