JS and JSON Flashcards

1
Q

What is JSON?

A

a text based data format following JS object syntax.It can be used independently from JS.

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

What are serialization and deserialization and why are they useful?

A

serialization is the process of turning an object in memory into a stream of bytes so you can do stuff like store it on disk or send it over the network. Deserialization is the reverse process, which turns a string of bytes into an object in memory

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

How do you serialize data into a JSON string using Javascript?

A

by using the JSON.stringify( )

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

How do you deserialize a JSON string using JS?

A

by using the JSON.parse( )

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

What is a client?

A

some sort of machine that can send a request to a server. For example the browser is a client or a terminal.

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

What is a server?

A

computer machine that provides the resources. Purpose is to send responses to a request

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

Which HTTP method does a browser issue to a web server when you visit a URL?

A

GET is the method. There’s also put, post, as other ones

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

What are the formats of HTTP Request and Responses?

A

start with a start line that contains info of request,
second is the headers and responsible with describing the request, then you have an empty line, then an optional body that contains information that you are trying to send or get back.

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

How does ajax work?

A

the browser requests info from a web server then processes the server’s response and show it within the page by using ajax

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

Why did we need the jquery CDN?

A

its a quick and concise JS library that simplifies AJAX interactions.

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

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

A

by using the method property

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

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

A

you want to be able to handle all sorts of data

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