The Blunder :
Before installing any new codes in his template a person should make sure that the script or style tags are properly closed. Most of the times you forget to copy the ending script tag, and in the end ultimately it shows errors. For those who don’t know a lot they use codes like this:<script>
jQuery(document).ready(function($) {
---------------------------
---------------------------
---------------------------
});
Here, it can clearly be seen that the <script> tag is not followed by a proper closing </script> tag which is wrong. The correct technique is to close the tags properly, like we do in simple HTML. Let's go ahead and look at the right way of doing it.
How to Correctly Add JavaScript codes in Blogger?
Adding Scripts in Blogger is extremely straightforward. All you need to do is to go to Blogger.com >> Your site >> Template >> Edit HTML. Now it depends on you where you would like to paste your JavaScript coding. However, we prefer you to add it above the </head> tag because this is the place where all technical things are present. Here’s how the code would look like:<script type='text/javascript'>
//<![CDATA[
Your JavaScript coding here
//]]>
</script>
Once the script is correctly added in your template hit the “Save Template” button, and this you would not face any errors. Which means that the JavaScript is correctly added in your blogger template.
We hope this tutorial has helped you in learning how to properly add javascript codes in blogger. Let us know about your experience? In case you have faced such errors too. Feel free to leave any error below that you are facing while adding new codes to your template.
0 comments:
Post a Comment