JavaScript Tutorial Series - Set Up

JavaScript runs in a web browser, so all that is needed to get started is having a web browser, such as Google Chrome, Firefox or Internet Explorer, etc. installed on your computer. That's it. Super simple.

Implementation:

The goal of this JavaScript Tutorial series is to teach JavaScript to someone with programming knowledge. This tutorial will help you create a basic website using HTML and CSS that has JavaScript added to it to for dynamic functionality. The JavaScript will call a REST api and use the returned data to display the user's current weather on the webpage. Don't worry if you don't know HTML or CSS. Those pieces will be minimal. The focus will be on JavaScript.

The first step in the tutorial is to create a directory on your computer where the tutorial files will live. Once that directory is made, add a file called index.html. Add a directory called css. Inside it create an empty file called style.css. Create another directory called js. Inside it create an empty file called javascript_tutorial.js.
The contents of the index.html file should contain the following:
<html>

    <head>
        <link rel="stylesheet" href="css/style.css"/>
    </head>

    <body>
        <header>
            <nav>
            </nav>
            <article id="toolbar">
                <article id="currentWeather" class="text-center">
                    <section id="location">
                    </section>
                    <section id="weatherTemperature">
                        <span id="temperatureValue"></span>
                        <span id="degreeSymbol">°</span>
                        <span id="temperatureUnits"></span>
                    </section>
                    <section id="weatherDescription">
                    </section>
                    <img id="weatherIcon">             
                    </img>
                </article>         
            </article>

        </header>
        <main>
        </main>
        <footer>
        </footer>

        <script src="js/javascript_tutorial.js"></script>
    </body>
</html>

The contents of the style.css file should contain the following:

header nav {
  height: 10vh;
  border-bottom: 1px solid darkgray;
}

header #toolbar {
  height: 5vh;
  border-bottom: 1px solid darkgray;
}

main {
  height: 72vh;
  border-bottom: 1px solid darkgray;
}

footer {
  height: 10vh;
  border-bottom: 1px solid darkgray;
}

JavaScript Tutorial Series Table of Contents:




(paid links)
More JavaScript

Comments