Add Javascript In Blogger
Adding JavaScripts in Blogger is extremely straightforward. 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.
There Are Three ways To Add Javascript In Blogger
{tocify} $title={Table of Contents}
- Add Javascript In Blogger Mannually
<script type='text/javascript'>//<![CDATA[Paste Your JavaScript Code 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.
- Add Javascript in Blogger Through Widget
If the script is small and used only for that particular widget then this is the preferred method. Just put the script in an HTML/Javascript gadget/widget together with the rest of the widget codes, like this:
<script type='text/javascript'>Paste Your JavaScript Code Here</script>
- Host the javascript/js file externally (outside of Blogger server)
The external script must not contain the <script type='text/javascript'></script> tags. After uploading the file to Google Sites, get the direct link to the file and Scripts located within the head and body section of a page can cause page load delays as the browser tries to load and execute these script(s) even before the actual content of the page. This is why these scripts are referred to as render blocking JavaScript. One way to resolve this issue is to move all your scripts to the footer of the page, but in the event that this is not possible, another
If you have external JavaScript file then find </head> tag in HTML editor of your blogger blog template and paste that file just above </head> tag Blogger doesn’t provide its users the flexibility to host CSS or JavaScript files in one separate link. They are hosted within the website’s coding through HTML Tags. For StyleSheet, <style> tag is use to define the style information for an HTML document.
Add Javascript In HTML
Add Javascript In HTML
Adding JavaScripts in HTML is extremely straightforward. 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.
There Are Two ways To Add Javascript In HTML
- Add Javascript In HTML Mannually
<script type='text/javascript'>//<![CDATA[Paste Your JavaScript Code 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.
- Host the javascript/js file externally (outside server)
The external script must not contain the <script type='text/javascript'></script> tags. After uploading the file to Google Sites, get the direct link to the file and Scripts located within the head and body section of a page can cause page load delays as the browser tries to load and execute these script(s) even before the actual content of the page. This is why these scripts are referred to as render blocking JavaScript. One way to resolve this issue is to move all your scripts to the footer of the page, but in the event that this is not possible, another
If you have external JavaScript file then find </head> tag in HTML editor of your blog template and paste that file just above </head> tag Blogger doesn’t provide its users the flexibility to host CSS or JavaScript files in one separate link. They are hosted within the website’s coding through HTML Tags. For StyleSheet, <style> tag is use to define the style information for an HTML document.
Nice Post,thanks for such a good information's
ReplyDeletewell explained...
ReplyDeleteVery good �� website for tips and tricks
ReplyDelete