Display source code/HTML code on Blog/WebSite

I tried to paste a sample code of a JavaScript function on blogspots (on Compose mode), unfortunately, it have get rendered. When I publish the post I cannot see any of my Javascript.

After trying it several time, finally I have figured out how to show HTML/Javascript source code on a blog post.
Here it is the solution:
1) Replace all the “<” with “<” and “>” with “>” (with out the “speech mark” surrounded it)
2) create a PRE tag on the Edit HTML code just before where you want to place the source code. if you do not use the

 tag the code that you placed on Edit HTML mode will lost all the format and it will look mess.
3) Once you done that you can place your source code in Edit HTML Mode.
4) make sure you closed the

5) Click on the “Compose mode” or the Preview button to check if it can show the code as what you expected.

Good luck

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.