Friday, November 29, 2013

How to Properly Add JavaScript Codes in Blogger


By on Friday, November 29, 2013

Add javascript codes in blogger by following simple steps.

While adding java script codes in blogger we usually face different types of problem like  line 768,Error parsing XML, column 20: The content of elements must consist of well-formed character data or markuplt means that code is not placed properly or the code is not developed correctly by the developer.Many bloggers face these types of problem.

Today i will give you tutorial how to properly add javascript codes in blogger.

First Step To Follow

Before installing code you should keep in mind that style tags or script are properly closed or not.Usually we forget to copy the ending script and then in the end it shows error.If you don't know let me tell you they use codes like this

<script>
jQuery(document).ready(function($) {
---------------------------
---------------------------
---------------------------
});


Here you can clearly see that <script> is not followed by the correct closing </script> tag which is not corect.The proper technique is to close tags properly like we usually do in HTML.

How to Properly Add JavaScript Codes in Blogger

Now to add properly add javascript codes in blogger just follow simple steps.

1. Go to blogger.com
2.Click on your site
3.Template
4.Edit HTML

Now it depends on you where to place java script code. However we prefer you to add java script code just before </head> tag.Here is how the correct code will look like.

<script type='text/javascript'>
//<![CDATA[
Your JavaScript coding here
//]]>
</script>


Once you place the correct java script code as mentioned above you will not face any type of error.In nutshell the code is perfectly placed. Hope this tutorial has helped you a lot.

About Rafay Ansar

Rafay Ansar is a young geek, freelancer writer, blogger, social media expert and author of MakeSomeSense. He writes about technology, Information and Securities, Web Development, Tips And Tricks, Blogging And Other Web resources.