The same time, Microsoft also invented JScript, the Microsoft's client side scripting language for their Internet Explorer 3. But JScript was meant for Internet Explorer only.
Timeline of Web Technologies
|1991||HTML, WWW Formed|
|1997||ECMA 1||First Edition|
|1997||ECMA 2||Some Editorial Changes|
|1999||ECMA 3||Add Regular Expressions, Try Cache, new string handlers.|
|2009||ECMA 5||Add Strict Mode, getter and setters, JSON and More features in Objects.|
|2011||ECMA 5.1||ECMA Standards are fully aligned with 3rd Edition of ISO/IEC.|
|2015||ECMA 6||Also known as ES2015, adds Classes and Modules, Array functions and Promises.|
|2016||ECMA 7||Also known as ES2016, includes two new features: the exponentiation operator (**) and Array.prototype.includes.|
|2017||ECMA 8||Also known as ES2017 includes await/async, which works using generators and promises.|
|Chrome V8||Google Chrome, Edge Chromium|
|Spider Monkey||Firefox, Netscape Navigator|
|Chakra||Internet Explorer, Edge|
Here are the examples with code.
<script> tag. See example
<button onclick="alert('Hello JS')">Check</button>
To view console window, use these shortcuts.
|Browser||Console Shortcut for Windows / Linux||Console Shortcut for Mac|
|Chrome||Ctrl + Alt + j||Cmd + Alt + j.|
|Firefox||Ctrl + Shift + k||Cmd + Alt + k|
|Internet Explorer||Ctrl + 2 or F12||NA|
|Edge||Ctrl + 2 or F12||Cmd + Alt + j|
|Safari||Ctrl + Alt + c||Cmd + Alt + c|
<script> var x="hello string"; console.log(x); </script>
To clear console, use
Alert box, i.e alert() or window.alert() is used to show output in dialog box. For alerts , use alert(). Alert generally block the code, thus next code block will run only after alert is closed.
<script> var x="hello js"; alert(x); </script>
prompt() or window.prompt() dialog box is used to receive input from user.
<script> var x=prompt("Enter Name"); alert(x); </script>
confirm() or window.confirm() dialog box is used to get confirmation from user. This will show Ok or Cancel in dialog box.
<script> var x=confirm("Press Ok or Cancel"); alert(x); </script>
//. This will comment only right hand side of code.
<script> // single line comment </script>
/* opening and
*/ closing, same like css comments.
<script> /* Multiline Comment */ </script>
Noscript Tag use