click below
click below
Normal Size Small Size show me how
Web DSS Exam 2 again
JavaScript
| Term | Definition |
|---|---|
| JavaScript pros | adds interactivity, mainly used for client side execution (run on browser) |
| JavaScript cons | client may not have enough processing resources, can be turned off for security |
| JavaScript is not java | no graphical user interface, read/write file access, not class based, NEEDS A BROWSER |
| what JavaScript can do client side | control browser features, modify document content, manipulate images |
| JavaScript CSS | visual enhancement that CSS can't do, advanced animation (NOT a replacement) |
| where to put JavaScript embedded | <script> |
| where to JavaScript in own file | src 'inputValidator', type = 'text/javascript' |
| Javascript variables | can be letters, digits, underscores, $ (NOT a space or starting w/ a digit) |
| is JavaScript case sensitive? | YES |
| A JavaScript function without a name is called…? | anonymous function |
| JavaScript addition, subtraction, increment | +, -, ++ |
| logical operators (and, or, not) | && (and), || (or), ! (not) |
| JavaScript comment | /*code/* |
| string concatenation | x = '5' + 5 x = '55' |
| date and time | new Date() |
| conditional if, else | if (condition) {} else {}; |
| conditional while | while (condition){}; |
| conditional loop | do {code} while(condition); **runs at least once |
| input/output in JavaScript | limited bc of security |
| output examples | window.alert() document.write() |
| input examples | window.prompt() confirm() |
| debug examples | console.log() |
| post increment | b = a++ b takes on a value, then a gets incremented |
| pre increment | b = ++a a is incremented first, than b takes on new a value |
| JavaScript functions | math, string, date/time, arrays |
| JavaScript function format | function () {} |
| ways to return control to function | right brace, executing return or "return expression" |
| can functions be referenced by a variable or another function? | yes |
| an array is represented by what symbols? | [] |
| the first element in an array is what? | 0 |
| push() | adds new element to end of array |
| pop() | removes last element and returns it |
| shift() | removes first element and returns it |
| JavaScript events | allow scripts to respond to user interactions and modify the page |
| load event | happens when the window load object fires, all children and external files are loaded |
| event handler | a function that responds to an event (addEventListenter) |
| mouseover event | when mouse hovers over element, event occurs |
| mouseout event | when mouse moves away from element, event occurs |
| window object | open window in browser |
| window methods | alert(), setTimeout (calls function for number of milliseconds), setInterval (call function at interval milliseconds) |
| document object | the root of an HTML element |
| DOM | Document Object Model |
| DOM specifies... | HTML and XML elements |
| JavaScript can edit... | |
| A node can have multiple children and how many parents? | |
| the html node in a DOM tre is called? | |
| document.getElementbyId() | |
| document.queryselectorAll() | |
| dot operator returns element attribute values like... | |
| document.getElementsByTagName() | |
| DOM Collections | |
| collection length | |
| document.images[0] | |
| element.innerHTML | |
| element.style.visibility = "hidden" | |
| document.write(text) |