JS and JSON Flashcards
What is JSON?
a text based data format following JS object syntax.It can be used independently from JS.
What are serialization and deserialization and why are they useful?
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 do you serialize data into a JSON string using Javascript?
by using the JSON.stringify( )
How do you deserialize a JSON string using JS?
by using the JSON.parse( )
What is a client?
some sort of machine that can send a request to a server. For example the browser is a client or a terminal.
What is a server?
computer machine that provides the resources. Purpose is to send responses to a request
Which HTTP method does a browser issue to a web server when you visit a URL?
GET is the method. There’s also put, post, as other ones
What are the formats of HTTP Request and Responses?
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 does ajax work?
the browser requests info from a web server then processes the server’s response and show it within the page by using ajax
Why did we need the jquery CDN?
its a quick and concise JS library that simplifies AJAX interactions.
How do you specify the request method(GET, POST, etc) when calling ajax?
by using the method property
Why might you need to build elements dynamically with data from AJAX request?
you want to be able to handle all sorts of data