7 - Javascript Flashcards
Name some JS math objects
Math.max(x,y,z….,n)
Math.min….
Math.pow(x, y) (x to the power of y)
Math.sqrt(x)
Name some examples of the ‘document. object methods
document. write(string)
document. writeln(string)
Example of a window object
window.alert(“Welcome to MMU”);
Properties are object attributes, true or false?
True document is the object, bgcolor is the property of:
document.bgcolor:
What are methods?
Methods are actions applied to objects ie document.write(“Hello World”);
- document is the object
- write is the method
onclick is a…
JS event:
<br></br>
<a>
Hover Me!</a>
Functions are named statements that perform tasks?
True. ie:
function myFunction (){ statement here }
What can be popped up to get the user to enter something?
window.prompt(“Enter first number”, “0”);
How do we call the following function in a button?
function myFunction() { document.write(Date()); }
Try it
How do we get an element by its id?
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];
The 5 layers of the networking model are:
Application Layer (http) Transport layer (tcp) Internetwork layer (ip) Network interface layer (ethernet) Physical layer