JavaScript Technology Extensions Flashcards

1
Q

The readyState value in an AJAX transaction can be between 0 and 4. This value determines the state of the XMLHttpRequest object at the time that the script asks for the state.

A

True

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

Readystate value

A

The readyState value in an AJAX transaction can be between 0 and 4. This value determines the state of the XMLHttpRequest object at the time that the script asks for the state.
Monitoring these states helps to ensure that the data remains secure.

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

The XMLHttpRequest object does not perform the transfer of data between a client and a server, it is done by HTTP or HTTPS. It requests the transfer of any XML or text-based data between a client and server. .

A

The readyState property is used to determine the state of the XMLHttpRequest object, which helps in keeping a track of operations that have been performed, and the operations that are still pending

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

A schema is a description of the tables and fields in a database, the relationships among them, and the structure to organize and describe the data.

A

True

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

AJAX is most known for its asynchronous calls that allow developers to update a section of the webpage without loading the entire page again.

A

True

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

AJAX can handle a variety of server requests for end-users. A typical AJAX-based request is returning server variables from the server to the client. This can be used to update content such as date and time.

A

True

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

Which method initializes an HTTP request?

A

The open() method initializes an HTTP request. It must be invoked before the request is sent.

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

Which programming language is typically used in AJAX transactions to query databases?

A

SQL

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

What is the main role of JavaScript in an AJAX transaction?

A

The main role of JavaScript in an AJAX transaction is to manipulate the DOM (Document Object Model), changing the elements in the browser. XML is used to control the browser display in the context of the content. The XMLHttpRequest object is used to request data and send responses, from and to a server, respectively.

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

Readystate table

A

readyState

State

Description

0

Uninitialized

An XMLHttpRequest object has been created, but not initialized.

1

Ready

Code has called the XMLHttpRequest open() method, and the XMLHttpRequest object is ready to send a request to the server.

2

Sent

A request has been sent from the client to the server with the send() method, but a response has not yet been received.

3

Receiving

The HTTP response headers have been received from the server, but the message body has not yet been completely received from the client.

4

Loaded

The response has been completely received by the client.

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

How do XML and JSON differ?

A

XML requires an XML parser, whereas JSON can be directly parsed through the JavaScript parser. Both XML and JSON are hierarchical, can be fetched using the XMLHttpRequest object, and can send and receive data as text.

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

What does the XMLHttpREquest requests?

A

The XMLHttpRequest object requests the transfer of XML or JSON data between a client and a server. The data transfer is performed by HTTP or HTTPS.

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

What does the readyState value 1 say about the state of the XMLHttpRequest object?

A

A readyState value of 1 signifies that the XMLHttpRequest object is in the ready state. It means that the open() method has been called and the XMLHttpRequest object is ready to send a request to the server

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

What relationship describes an association between two tables in which one record of either table is related to the many records of another table?

A

A many-to-many relationship refers to a relationship between tables in a database when a parent row in one table contains several child rows in the second table, and vice versa. For example, a many-to-many relationship exists between customers and products. In this relationship, customers can purchase various products, and products can be purchased by many customers.

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

What is the format of the data that is exchanged with the browser using JSON?

A

Text

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

AJAX refreshes a webpage by:

A

making server requests via XMLHttpRequest to refresh the requested portion of the page.

17
Q

AJAX combines multiple technologies. What are the two major technologies it uses?

A

AJAX is not a single technology, but a combination of two technologies, namely, JavaScript and Extensible Markup Language (XML), with the key object being XMLHttpRequest. That’s why the full name of AJAX is Asynchronous JavaScript and XML.

18
Q

What readyState value specifies that the response header has been received, but the message body is yet to be received?

A

A readyState value of 3 tells a script that the HTTP response headers have been received from the server, but the message body has not been completely received from the client.

19
Q

What initializes the HTTP request in an AJAX transaction?

A

The open() method is used to initialize the HTTP request before the request is sent. It must be invoked before sending the request.

20
Q

What is true of a promise returned for a fetch request?

A

The promise represents the data received from the server. It is resolved in the Response object. It is returned whether the request is successful or not.

21
Q

In an AJAX transaction, which readyState value indicates that the HTTP response headers have been received from the server, but the message body has not yet been completely received from the client?

A

The readyState value in an AJAX transaction can be between 0 and 4. This value determines the state of the XMLHttpRequest object at the time that the script asks for the state. Monitoring these states helps to ensure that the data remains secure. Here are the readyState values:

When the value is 0, it means that the XMLHttpRequest object has been created, but not initialized.
When the value is 1, it means the XMLHttpRequest object is ready to be sent.
When the value is 2, it means the XMLHttpRequest has been sent but no response has been received yet.
When the value is 3, it means that the HTTP response headers have been received from the server, but the message body has not yet been completely received from the client.
When the value is 4, it means the response has been completely received and loaded by the client.

22
Q

Which property determines the state of the XMLHttpRequest object?

A

readyState

23
Q

Which method clears the data item for the specified key in the Web storage API?

A

The removeItem() method clears the data item for the specified key. It takes a single argument, which is the key of the data item to be deleted

24
Q

Which API lets you specify where the data is stored in a Web browser?

A

The Web Storage API is used to store the data in a user’s browser locally. This API also lets you specify how this data is stored and used in a Web browser.

25
Q

Does the canvas element has any drawing capabilities of it’s own?

A

No

26
Q

Which method will remove all the data from the storage?

A

localStorage.clear()

27
Q

What is the most appropriate definition of an API?

A

An API (Application Program Interface) is a set of subroutine definitions, rules, and tools for building application software. These subroutine definitions are a set of instructions defined to perform a specific task. APIs contain methods that allow them to communicate with specific software components. These are mostly known for the wide set of tools that they provide to the developers. APIs may be Web-based, operating systems, database systems, and so on.

28
Q

What is the difference between the data stored using the localStorage object and the sessionStorage object?

A

Both the objects, sessionStorage and localStorage, store the data on the user’s browser with one exception: the data stored using the sessionStorage object gets cleared as soon as the current session ends, whereas the data stored using the localStorage object is not cleared even after the current session ends and the browser is closed.