7 - Javascript Flashcards

1
Q

Name some JS math objects

A

Math.max(x,y,z….,n)
Math.min….
Math.pow(x, y) (x to the power of y)
Math.sqrt(x)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Name some examples of the ‘document. object methods

A

document. write(string)

document. writeln(string)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Example of a window object

A

window.alert(“Welcome to MMU”);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Properties are object attributes, true or false?

A

True document is the object, bgcolor is the property of:

document.bgcolor:

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are methods?

A

Methods are actions applied to objects ie document.write(“Hello World”);

  • document is the object
  • write is the method
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

onclick is a…

A

JS event:

<br></br>

<a>
Hover Me!</a>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Functions are named statements that perform tasks?

A

True. ie:

function myFunction (){
statement here
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What can be popped up to get the user to enter something?

A

window.prompt(“Enter first number”, “0”);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How do we call the following function in a button?

function myFunction() {
   	document.write(Date());
}
A

Try it

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How do we get an element by its id?

A

If the top of the code has:

<p> The date will appear here </p>

document,getElementById(“date”[this calls the date element].innerHTML = “21st Jan 2013”[this passes this text back to the date id];

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

The 5 layers of the networking model are:

A
Application Layer (http)
Transport layer (tcp)
Internetwork layer (ip)
Network interface layer (ethernet)
Physical layer
How well did you know this?
1
Not at all
2
3
4
5
Perfectly