Browser-Server Communication Flashcards

1
Q

How can you pass data to the server?

A
  1. Using “?param=value” chain after the server .address.

2. Using FormData interface.

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

How can you convert any JavaScript object into a JSON string?

A

Use .stringify() method of JSON JavaScript object. Example:

var myArr = [1,2,"Hello"];
var jsonString = JSON.stringify(myArr);

JSON is a built-in JavaScript object that has only 2 methods for parsing and converting values to/from JSON format.

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

How can you parse a string into a JSON object?

A

Use .parse() method of JSON JavaScript object.

JSON is a built-in JavaScript object that has only 2 methods for parsing and converting values to/from JSON format.

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