Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I add JavaScript inside Blogger?

I would like to add some JavaScript inside Blogger.

<script type="text/javascript"> window.open("http://www.page.html", "myWindow",      "status = 1, height = 400, width = 400, resizable = 0"); </script> 

If I edit the HTML and I add " and ' they get converted to quote ...

If I add an HTML/JavaScript widget the code won't run.

like image 750
Patrioticcow Avatar asked Jun 23 '11 05:06

Patrioticcow


People also ask

How do I add JavaScript?

You can add JavaScript code in an HTML document by employing the dedicated HTML tag <script> that wraps around JavaScript code. The <script> tag can be placed in the <head> section of your HTML or in the <body> section, depending on when you want the JavaScript to load.

How do I show the code on Blogger?

To display codes on a Blogger blog post, you should do two things. The first step is to convert them to escaped characters. The second step is to use the HTML tag pre. You should write the parsed HTML/JavaScript inside the tag pre.

Where is the best place to insert a JavaScript?

JavaScript in <head> or <body> You can place any number of scripts in an HTML document. Scripts can be placed in the <body> , or in the <head> section of an HTML page, or in both.


1 Answers

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.

like image 118
George Cummins Avatar answered Oct 11 '22 18:10

George Cummins