Wednesday, September 16, 2009

Adding html code or java script into your blogger post

I have been around for a while looking for workable ways of putting a html code or java script into post in blogger. That is to show the code or script text in the post rather than executing it. So there are many ways, I found. But none of them I found working so far, including the following:

<a onclick=javascript:showMessage() href="#" >Test</a>
<script language="JavaScript">function showMessage(){alert("Is working in post?");}</script>
Then, I landed on a page explaining the role a third party web service. The page is called Centricle and its service is to add necessary attributes to the code so that the code will appear and read as text.

The steps are very simple.
  1. Open the Centrice (it is free and no need to register);
  2. Copy your original html code or javascript and paste it into the box of the Centrice;
  3. On the Centrice, press Encode button.
  4. Copy your encoded html code or java script and paste it into your post.
  5. Publish your post to see the result

0 comments:

Post a Comment

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites More