It is a major problem for all techie blogger who used to post codes daily as well as those new blogger who frequently post codes. Blogger supports HTML and Javascripts language to excute within blogger post. Here is the ultimate solution for them. The main problem is when we post a raw HTML / Javascripts , it is excuted. You may noticed when we write some code as a post, it does not appear as a post. Replacing "<" by < and ">" by > can solve your problem if your code is small. But usually scripts are too large to manage them with replacing them by hand. So, here some software can fix this problem. But, Have you ever think of solving this problem online by your self. Yes, you can solve this bug with a tiny code. It is better than using any software / website for HTML/javascript converter/ replace system. now have a look on the code:
Place all the code in a post or page. Create a post or page in blogger and name it HTML online converter. Then paste the code given below & you are done.
Place this code where you want to place the converter./** here the HowBloggerCode stars ** / <script> function HowBloggerCode(){ var hbc; hbc = document.getElementById('hbcconverter').value; if(hbc==""){ alert('Please input the code/script you want to convert for blogger'); }else{ hbc = hbc.replace(/</g,"<"); hbc = hbc.replace(/>/g,">"); document.getElementById('hbcconverterresult').value = hbc; } } /** here the HowBloggerCode ends ** / </script>
if you need style then copy it otherwise ignore it.<textarea id="hbcconverter" style="height: 350px; width: 98%;"></textarea> <input type="button" value="convert" onclick="HowBloggerCode()" /> <textarea id="hbcconverterresult" style="height: 350px; width: 98%;"></textarea>
<style> textarea#hbcconverter, textarea#hbcconverterresult { width: 75%; height: 147px; margin-top: 25px; margin-left: 51px; background: black; color: white; text-shadow: 0px 0px 7px rgb(252, 197, 2); border-radius: 21px; padding: 20px; } input[type="button"] { background: black; color: white; float: right; border: none; padding: 8px; margin-top: 16px; margin-right: 269px; height: 31px; border-radius: 8px; } </style>
Now have the live demo: First put code in first Textarea and click on Convert. Converted code will shown on Second Textarea. you can add style using custom css to your converter.
LIVE DEMO: HTML CONVERTER/ REPLACER
You can use Smiley in Comment :P :D. So express your feeling. You can report any bug, you face during script installation. :P
ReplyDeleteGood site.......
ReplyDeleteThank you Arindam. Keep Visiting.
Deletehow i change the background from black to white. black is not suitable for my blogg.
ReplyDelete