Tuesday, November 10, 2009

How to write html/javascript code in blogger blog post?

write html/javascript code in blogger blog postIf you have ever tried writing HTML/Javascript code in your blogger blog post then you might have found that it does not appear as code in the post. Instead the code is interpreted and displayed.
The above problem can be simply fixed by replacing < with &lt; and > by &lt; . Here we are providing a few elegant ways to do this.
We will start with the toughest one first. If you like easy things just skip to the last step.




Method 1
  1. Open notepad and paste your code in it.
  2. Hit ctrl+h or choose Edit > Replace
  3. In Find what: box type < and in Replace with: box type &lt;
    and hit Replace all button
  4. Similarly for > type > in Find what: box and &gt; in Replace with: box.
  5. Your are done, the code is ready to be used in your post.

Method 2
  1. Paste your code in the text box below and hit Convert button.
  2. Done! Your code is ready to be pasted in your blogger blog post.
For easy access we suggest that you bookmark (ctrl+d) this page.

Method 3

The above method requires you to visit this page whenever you want to convert your code. This is waste of time and will also require your to have an active internet connection.
Let's make things a bit easier download html converter now.


Method 4

The next method is the official solution from blogger. If you need to write html code in your post just select post options and in compose settings choose Show HTML literally. Any code now written will not be interpreted as HTML.






End of part 1/2 of how to write code series.
In the next part we will tell a few ways to highlight your code.

7 comments:

  1. Very nice converter. I took liberty to modify it and put the modified version up on my blog at Embed and Highlight Source Code in HTML.

    ReplyDelete
  2. hey please update the link for html converter !!
    and thanks for beautiful post

    ReplyDelete
  3. hey thanks a lot.
    it really worked!
    i have google for a hour just for find nice tutorial like this.
    thanks!

    ReplyDelete
  4. If you are using visual studio, then you can copy any type of code html/css/javascript/c# etc to blogger. You have to install visual studio productivity power tools: for more info read: http://coding-issues.blogspot.in/2013/10/copy-code-from-visual-studio-to-blogger.html

    ReplyDelete

Newer posts Older post Home
 

Recent Posts

| © 2009 BloggerFunda.blogspot.com | Template by Blogger | Enhanced By Abhishek Kumar |
| Site best viewed in Firefox@1024X768 or higher resolution. |