SheTech
  • SheTech JS bootcamp
  • Level 1 - awesome tasks
    • Introduction to Awesome Tasks
    • Step 1: HTML
    • Step 2: playing with the DOM
    • Step 3: add a new task
    • Step 4: dynamic list of tasks
    • Step 5: adding new items
    • Step 6: removing items
    • Step 7: add some style
    • Step 8: marking items as done
    • Step 9: saving items in the localstorage
    • Step 10: adding filters and bulk actions
    • Step 11: add counters
    • From Awesome Task to the next big thing!
  • Level 2 - timeline
    • Live Timeline
    • Step 1: basic HTML page
    • Step 2: add util library
    • Step 3: show all posts
    • Step 4: add form
    • Step 5: collect form data
    • Step 6: create a new post
    • Step 7: validating posts
    • Step 8: refactoring
    • Step 9: refresh button
    • Step 10: auto refresh
  • Code Editors
  • Useful resources
  • API Reference
  • Glossary
Powered by GitBook
On this page
  • Key concepts
  • JavaScript
  • The DOM
  • The Web

Was this helpful?

  1. Level 2 - timeline

Live Timeline

A Facebook-like timeline

This tutorial will guide you through the development of the app.

We will be introducing new concepts on each step, so make sure you understand what's going on before going further! If you have any doubts, please ask your coach for help.

Key concepts

During the workshop we will be covering the following concepts:

JavaScript

  • Base values: String, Number, Boolean, undefined values

  • Variables and functions

  • Compound values: Array and Object

  • Language Structure: if, return

  • Global methods: setInterval

  • Array methods: forEach

  • HTTP-related methods: fetch

The DOM

  • Element and some of its properties and methods (querySelector, innerHTML)

  • The events and the event object main properties (target, preventDefault)

The Web

Internet, at its core, works in a very simple way.

You request for something (eg. a web page such as www.google.com) and at some point you get back a response. Yes, it's just that simple!

This request–response mechanism happens for example when entering a website address in the address bar of your browser. So it turns out browsers can help us making requests and handling responses.

So when working on our web applications, every time we want to communicate with the outside world, we can rely on our the capability of our browsers to handle a HTTP request and work on the response we get back.

HTTP request define a few methods to better specify the type of request you want to create. We won't go too much into details here, but it's useful that you learn at least the two most common methods one can use: GET and POST.

  • The GET method is usually used when you want to retrieve some remote resource

  • In contrast, the POST method is used when you want to send over something over to some remote entity

We can then use our browsers' capability of handling the HTTP protocol in our JavaScript applications.

fetch is an easy api. You can:

  • create your request for your remote resource just like this: fetch(MY_REMOTE_RESOURCE)

  • you can then work on the response by defining the usual so-called callback function and giving it to the then method

It'll look like this:

fetch('http://some_remote_url')
  .then(function(response) {
    // do something with your response object
  })
PreviousLevel 2 - timelineNextStep 1: basic HTML page

Last updated 4 years ago

Was this helpful?

Going a level deeper we find out that this is because they're good at handling the communication protocol the World Wide Web is built on: .

More specifically the api we will be using go by the name of .

Http
fetch