Saturday, June 02, 2012
Html And JavaScript Parsing Widget. This widget is dedicated to those who're troubled in showing HTML and/or JavaScript code on their websites/blogs. Such as on blogger. In order to be able to show HTML or JavaScript code on a post, a blogger will have to decode the code first before he publishes it. There are two ways to decode HTML/Javascript code, manually and using parsing widget. The only problem to do it manually is that when you write too long code to decode, i'm sure you don't wanna make it yourself. Using parsing widget is just more preferable, you only have to copy the code that you'd like to decode, insert it to the widget and then take the code generated, and finally paste it in your article and done.

How To Install That Widget?

Piece a cake. Just put the code below somewhere on your blog. You can add it straight to your template or even by adding Html/JavaScript widget on your blog and put the code in it. Or you can also publish a new post and then put the code in it.

The code above looks like the below.

<script type="text/javascript">function convert(){var ele1 = document.getElementById("somewhere");var replaced;replaced = ele1.value;replaced = replaced.replace(/&/ig, "&amp;");replaced = replaced.replace(/</ig, "&lt;");replaced = replaced.replace(/>/ig, "&gt;");replaced = replaced.replace(/"/ig, "&quot;");replaced = replaced.replace(/&#177;/ig, "&plusmn;");replaced = replaced.replace(/&#169;/ig, "&copy;");replaced = replaced.replace(/&#174;/ig, "&reg;");replaced = replaced.replace(/ya'll/ig, "ya'll");ele1.value = replaced;}</script><table border="0" cellpadding="0" cellspacing="0" style="width:550px;"><tbody><tr> <td valign="top" width="550"><textarea cols="50" id="somewhere" rows="14" style="background: none repeat scroll 0% 0% rgb(250, 250, 250); border: 2px solid rgb(0, 0, 0);">Insert Html/JavaScript</textarea><input onclick="convert();" type="button" value="convert"/></td> </tr></tbody></table>

Here is how that widget will look like.

That's all everybody. Hope this usefull. :)