Add Javascript snippet code to your Blogger post

November 5th, 2009.

Javascript in Blogger Posts
If you’ve ever tried to add Javascript code into a blog post, such as when displaying a ‘snippet’ for your readers to copy and paste, you’ll no doubt have found that Blogger stops your code snippet being displayed at all. I can only assume this is to stop malicious javascript exploits.
There is a simple online tool that can help you over at eBlog Templates. This tool will convert your javascript code into a form that Blogger / Blogspot will be happy to publish!

Javascript in Blog Post 1

Put in your javascript snippet code like so… and click to convert.

Javascript in Blog Post 2

Select your converted code, then copy+paste it straight into your blog post.

The tool simply converts characters to their raw HTML form, for instance ‘<becomes ‘&lt;’
The output may look a mess, but once you publish the blog post your web browser will revert the inputted snippet back to the its original state. Blogger and your readers are none the wiser! How handy!

It's good to share

  • email
  • RSS
  • Digg
  • Facebook
  • del.icio.us
  • Twitter
  • StumbleUpon
  • Technorati
  • Google Bookmarks
  • LinkedIn
  • Tumblr
  • Mixx
  • MySpace

About

Mark is a web designer / developer working for Internet Assets from Lancashire, England. He is a graduate of Graphic and Communication Design from the University of Leeds, and is keen on all things related to technology.

Don't be shy. Leave a comment!

(Required)

(Required, not published)