Javascript (JQuery, JSON, AJAX, etc.) Flashcards
1
Q
Function
A
Functions are one of the fundamental building blocks in JavaScript. A function is a JavaScript procedure—a set of statements that performs a task or calculates a value. To use a function, you must define it somewhere in the scope from which you wish to call it.
2
Q
Function Definition
A
A function definition (also called a function declaration) consists of the function keyword, followed by:
- The name of the function.
- A list of arguments to the function, enclosed in
parentheses and separated by commas. - The JavaScript statements that define the function,
enclosed in curly brackets, { }.
3
Q
Get an HTML element by ID
A
document.getElementById(‘txt_name’);
4
Q
Remove HTML element
A
element.remove();
5
Q
Reload current page from cache
A
location.reload();
6
Q
Reload current page from server
A
location.reload(true);