We Are Inviting Guest Writers,If Interested, please send your complete article to contact@livetricks.in

Thursday, September 8, 2011

Writing HTML/Javascript Code In a Blog Post

It is a very useful tool for all bloggers who want to suggest some code editing or writing any post which contains some HTML/Javascript example.It is a little bit difficult in blogger because when we write HTML/JavaScript in the post it will not show up as text. Actually blogger by default tries to interpret the written code. To overcome this, you will have to alter your HTML/JavaScript as follows:

  • Replace all the < characters with &lt; 
  • And all the > characters with &gt; (Exactly the same including the semicolons).
That's all and you are done now when you post it, it will shown exactly as the actually code which you want to show . For example if you want to write the below given code in your post <b:skin><![CDATA[. Then it will be written as &lt;b:skin&gt;&lt;![CDATA[ in the Compose box. It is better to write your post in a text-editor like Microsoft Word and use its “Find and Replace” feature to change the above characters with ease.