How can I add JavaScript inside Blogger?

Navigate to the Layout tab, click the "Add a Page Element" option and select the "HTML/Javascript" sub-option.

See the Layout Guide for more details.


You can run this code as an external source on your blog. How? Follow the below steps:

Step 1: Store your JavaScript code in github.com, pastebin.com or any file CDN.

Step 2: Use the below piece of code to call your JavaScript code from that external source:

<script src="http://example.com/script.js"/></script>

Include this code inside <head>.


Add your code like this:

<script type='text/javascript'>
//<![CDATA[

window.open("http://www.page.html", "myWindow", 
    "status = 1, height = 400, width = 400, resizable = 0");

//]]>
</script>

Create a post. Click to enter html as opposed to compose. Type your script. To the right Click Post Settings >> Options >> Compose Mode then change Show HTML Literally to Interpret HTML. It should now accept your script as a script intsead of text..