WD - Javascript

Cards (24)

  • Javascript was released by a popular browser of the time Netscape communicator
  • Uses curly brackets to contain the code belonging to functions or “if… then” statements
  • Javascript comes with very few modules
  • Function to say Hello World in console log

    function helloWorld() {
        console.log("Hello World");
    }
    helloWorld();
  • JavaScript is executed by the client web browser
  • As Javascript is executed on the browser the bandiwdth required and server processing is less
  • about:blank is a blank page within your browser
  •  Variables declared by var keyword are scoped to the immediate function body (hence the function scope) while let variables are scoped to the immediate enclosing block denoted by { }
  • Instead of colon what is used to show the beginning of a function in javascript?
    curly bracket
  • After each line of code in javascript, except ones with curly brackets what should be at the end of it?
    Semi colon
  • JavaScript functions can be stored in an external file rather than added directly to the HTML
  • Why are external javascript files used?
    As they can be used across multiple sites
  •  Events occur when the user or browser manipulates the page
  • The <button> tag can have an onclick event set
  • The HTML below creates a button that calls functionFinish on the webpage using the <button> and </button> tags.
    <button onclick="finishFunction()">Finish</button>
  • The button inline tag encloses what?
    The button label
  • HTML events for scripts:
    onmouseover The mouse hovers over an HTML element
    onmouseout The mouse moves away from an element
    onclick The primary mouse click is done on an elements
    onkeydown A keyboard key is pressed
    onload The browser has finished loading the page
  • TO reference in an element in javascript it is best to first assign it to a variable
  • Query selector is used as opposed to getElementBy___, it acts similarly returning the first matching element in a document
  • jquery can be imported and is used to increase website interactivity, its slogan is 'write less, do more'
  • querySelector null is returned if there are no matches.
  • what is the syntax of query selector, using 'selector' to represent selectors?

    querySelector(selector)
  • A selector references an element inside of a document, they are usually formatted like css rulesets.
  • Selectors use entity numbers and class names, like CSS