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.
About the Editorial Team
The Editorial Team of MyBloggerLab consists of a group of Professional Blogger geeks Led by Syed Faizan Ali (Founder of MyBloggerLab).
14 comments
What A Post Dear You're Doing Fabulous Job In Your Blogging Carrier Hope You Will Be A World Class Blogger In Future
Happy to know that you were listed as a top Pakistani Blogger !
And this is a mistake which som many widget makers make !
They do not close tags properly and we have to close it !
As a fan of My Blogger Lab - I request you to start publishing widgets here again!
We know that your widgets are of top quality !
We still want your widgets ! Please start sharing awesome widgets again !
Regards,
Rizwan @ Blogger Kid
great one but unfortunately I left blogger and started wordpress just because I found too much difficulties but reason could be I am a poor developer and don't know much of scripting.
its awesome
I have uploaded Javascript in Dropbox, Now I want to use the link address and use it in blogger to make length of code lesser. Is there any way ?
Are you uploading files to Public folder? If yes you can left click on it "View Public URL" Thats done
Thank you so much!
Very useful.
You fix my problem Sir..
I have developed an application using java script. I have copied that code and pasted in blog editor.
That application is not working properly.
The problem, and why this doesn't work is because in the code there is two "&&" which apparently does not belong and is causing an error.
for sure i am very grateful to this post
Thank you. It's really helpful.
Such A great Work For Blogging and Nice One Keep It Up Dear Faizan
This one really helps. I got also problem with rendering then I follow this to implement on my blog www.netishout.com. Thanks a lot!
I am glad it worked for you. Cheers
Post a Comment
We’re eager to see your comment. However, Please Keep in mind that all comments are moderated manually by our human reviewers according to our comment policy, and all the links are nofollow. Using Keywords in the name field area is forbidden. Let’s enjoy a personal and evocative conversation.