JQuery Quiz Questions Flashcards

1
Q

What is jQuery?

A

A library of code that uses someone else’s code

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

What is the jQuery selector function?

A

$

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

What does the jQuery selector function return?

A

An object

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

Why would someone use jQuery over vanilla Javascript?

A

For older code/ older browsers

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

What are some downsides from using jQuery over vanilla Javascript?

A

JQuery loads a ton of code to run a little bit of code. Also relying on a library can be bad

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

Why do we use the tag at the bottom of the body, instead of putting it inside the tag?

A

The html doc loads from top to bottom so if the script is in the top it won’t apply the script to the html elements below it

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

How do you get the text out of an HTML element?

A

.text() method

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

How do you get the value out of an HTML input field?

A

.val() method

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

What’s the difference between .text() and .html()?

A

Its similar to innerHtml and textContent. Just like innerHtml, you don’t want to use the .html()

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

What does .on() do?

A

Attaches an event handler function for one or more events to the selected elements

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

How does ajax work?

A

By giving it an object literal with the proper methods so that we can get back info

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

Why did we need the jQuery CDN?

A

To get the proper methods

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

How do you specify the request method (GET, POST, etc.) when calling ajax?

A

Specify the method property on the object

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

Why might you need to build elements dynamically with data from an AJAX request?

A

Because we need to wait for data to come in and then create elements dynamically when the data is received

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

Should you use named functions or anonymous functions for success and error handlers?

A

Named functions so they can be referenced later

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