Answers for "execute javascript code"

1

html execute javascript

<!-- 
	Method 1: external script 
	- Should be placed in the <head> section of your HTML
	- The 'src' should contain the path to a local file or external URL
	- The 'defer' attribute will make it execute after the DOM is loaded
-->
<script src="script.js" type="text/javascript"></script>
<script src="script.js" type="text/javascript" defer></script>

<!-- 
	Method 2: inline code 
	- Should be placed in the <head> or <body> section of your HTML
 	- Place it before the </body> to make it execute after the DOM is loaded
-->
<script> alert("Hello world!"); </script>
Posted by: Guest on May-31-2021
6

run code in javascript

node .
// or 
node index.js
Posted by: Guest on August-20-2021
1

how javascript code executes

Ignoring the workings of JS engines, the ECMA specification says there
should be two types of execution contexts:

- Global Execution Context
- Function Execution Context

Furtheremore, it states there should be stack

- Call Stack

And finally to connect everthing handle asynchronous code there is a loop

- Event loop

(Google those seperately, tons of stuff to learn for each)
Posted by: Guest on July-11-2021

Code answers related to "execute javascript code"

Browse Popular Code Answers by Language