Preview

01 - Introduction to Javascript

 1. HTML defines the content of webpages and CSS defines the layout. Javascript is responsible for ____________ and to program the ______ of pages.
You can use the video presentation for an overview 
of the concepts covered in this test.

  images only / style

  interactivity / behaviour

  alignment / style

  animations only / movement

 2. JavaScript ("JS" for short) is a dynamic programming language that, when applied to an HTML document, can provide interactivity on websites. It was created by Bill Gates in just 10 days!
brendaneich_jsfounder.jpg

  True

  False

 3. Mostly, JavaScript runs in your web browser alongside HTML and CSS, and can be added to any web page using a _____ tag.

  script

  mega

  jscripthtml

  body

 4. The script element can either contain JavaScript directly (internal) or link to an_____ resource via an src attribute.

  text only

  external

  nocturnal

  mixed

 5. Almost every line in JavaScript ends in a ___________ - you’ll be using them a lot.
>>;

  comma

  full stop

  space

  semi colon

 6. The following code will:
<script>
    document.write("Hello, world.");
</script>

  cause an error, as the script tags should be replaced with the word 'javascript'

  call an external file called 'Hello World' and try to run the program

  simpy print the words 'Hello, world' to the screen

  create an empty file called 'Hello world' (text file) which will be stored to your computer

 7. You can put comments into JavaScript code, just as you can in CSS. A comment is ________ .
/*
Everything in between is a comment.
*/  

// This is also a comment

  a type of variable that the programmer uses to store his thoughts on the program as it develops

  part of the code and will execute on pressing 'run'

  usually what causes an error in a program and should ideally never be used

  not part of the code but there to help the programmer maintain and understand the code

 8. Which of the following things can in-browser JavaScript do?
1 - Add new HTML to the page, change the existing content, modify styles.

2 - React to user actions, run on mouse clicks, pointer movements, key 
	presses.

3 - Send requests over the network to remote servers, download and upload 
	files (so-called AJAX and COMET technologies).

4 - Get and set cookies, ask questions to the visitor, show messages.

5 - Remember the data on the client-side ('local storage').

  3 and 5

  1, 2 and 3

  1 and 2

  All of the items on the list

 9. JavaScript and Java are completely different languages, both in concept and design.

  False

  True

 10. The HTML 'canvas' element is used to draw graphics, on the fly, via JavaScript and can also be used to create complete games in the browser.
The following video is worth a watch. It covers the technology used to 
make some extremely cool effects.

  True

  False