Saturday, December 3, 2011

How to Post HTML Code

Sometimes we need to insert html code in our posts on the blog. Before you posted to the blog page, html code must be changed first so by the blogger should not be construed as a script program but interpreted as text.

The trick is simple:
1. Open http://centricle.com/tools/html-entities/
2. Copy and paste the code in the space provided


3. Click Encode


4. The code is finished and ready for us to place it on the blog post.

Example code before the encode

<div id="google_translate_element"></div><script>
function googleTranslateElementInit() {
new google.translate.TranslateElement({
pageLanguage: 'en'
}, 'google_translate_element');
}
</script><script src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>

Code after the encoded

&lt;div id=&quot;google_translate_element&quot;&gt;&lt;/div&gt;&lt;script&gt;
function googleTranslateElementInit() {
new google.translate.TranslateElement({
pageLanguage: 'en'
}, 'google_translate_element');
}
&lt;/script&gt;&lt;script src=&quot;//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit&quot;&gt;&lt;/script&gt;

Thank you for visiting.

1 comment: