Free Online Javascript To Html Converter - Techs And Geeks | Tech Hacks | Tech News
templatesyard"/>

Free Online Javascript To Html Converter

The very first day I started blogging, I discovered that when I pasted script code on an html page, it immediately got butchered beyond recognition.

When you write code in a text editor, you often format it for readability, adding indents for code inside of functions, if statements, loops, etc. HTML generally ignores these indents, so your code ends up all jammed to the left side of the screen. To keep your indents, you must put your code within preformat tags.

Long lines tend to get wrapped to the next line, making your code confusing or even incorrect if someone tries to use it. To keep your lines from wrapping, you must wrap your code in tags and apply a CSS style rule to the div, setting the overflow setting to auto. This will put your code in a box with a horizontal scroll bar.





Then there's special characters. The XHTML treats certain characters as special, interpreting them as control codes. To display these characters on a web page, you must replace them with their corresponding XHTML codes, which are:

&lt; ( < )
&gt; ( > )
&amp; ( & )
&quot; ( " )
&39; ( ' )
&124; ( | )

So here is the tool. Just enter your code in the fisrt box and click Convert. The output will appear in the second box. At the bottom of the article, you can see the JavaScript code that makes it work. Enjoy..





SHARING IS CARING!

Post Bottom Ad