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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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, { }.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Get an HTML element by ID

A

document.getElementById(‘txt_name’);

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

Remove HTML element

A

element.remove();

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

Reload current page from cache

A

location.reload();

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

Reload current page from server

A

location.reload(true);

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