about
Bits Hello JavaScript
08/05/2023
0
Bits: Hello JavaScript
code, output, and build for JavaScript on Windows, macOS, and Linux
Synopsis:
This page demonstrates use of Visual Studio Code to build and execute a simple JavaScript "Hello World" program, showing its build process. The purpose is to show how to get started quickly.- Companion pages for C++, Rust, C#, and Python are accessible from links in the fixed right panel.
- Navigation through example levels for the same language is effected with the "Next" and "Prev" buttons in the menus or by using the "N" and "P" keys.
- The links in the left panel point to major sections of this page and all of the Bits pages for JavaScript.
Note:
Most page links in this site refer to specific points in a target page, usually the top. For all of the code bits here, links return to the last scroll position. This supports quickly moving between similar code for each of the languages covered. That maintains context for comparisons.
Most page links in this site refer to specific points in a target page, usually the top. For all of the code bits here, links return to the last scroll position. This supports quickly moving between similar code for each of the languages covered. That maintains context for comparisons.
Source Code - Js_Hello.html
<!DOCTYPE html>
<html>
<!--
Js_Hello.html
-->
<head>
<script>
function hello() {
document.getElementById("hello").innerHTML = "<h2>Hello Javascript World</h2>";
}
</script>
<style>
body {
font-family:'Comic Sans MS', Tahoma;
padding:2em;
}
</style>
</head>
<body>
<div id="hello"></div>
<script>
hello();
</script>
</body>
</html>
Output
Hello Javascript World
Build
local machine
C:\github\JimFawcett\Bits\Javascript\Js_Hello
> start firefox C:\github\JimFawcett\Bits\Javascript\Js_Hello\Js_Hello.html
C:\github\JimFawcett\Bits\Javascript\Js_Hello
>
github site
clone Bits repository and double click on Js_Hello.html
2.0 VS Code View
3.0 References
Reference | Description |
---|---|
JavaScript Tutorial - w3schools | Interactive examples |
JavaScript Reference - MDN | Informal syntax reference |
Bits Tooling | Tool chains, VS Code |