Mod 9 - The Dynamic Web Flashcards

1
Q

What is a web server & what does it do?

A

It is a computer with a name (ex. www.student.cs.uwaterloo.ca) and an address (ex. 129.97.167.19). The computer runs a software that waits for an http request (ex. reference: ~kamatson/hello.html) and retrieves the file to send back to the client.

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

What is a client?

A

It is usually a web browser running on a different computer than the server. The HTML is provided by the server and the client displays it. If the HTML references more than one page (ex. <img></img>) then the client makes additional requests to the server that hosts the image to display it properly.

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

What are the roles of a server?

A
  • respond to HTTP requests & provide files (HTML pages, images, etc.)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the roles of a client?

A
  • request files via HTTP
  • interpret HTML files and make additional requests if necessary
  • display HTML files properly
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a static web page?

A

It means a page that is not dynamic. If the page must be changed to display relevant information, it is static.

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

What is a dynamic web page?

A

A page is dynamic if it automatically changes the content to display relevant information based on its “environment”.

ex. sentence: “Today is Tuesday” will change the day according to what day it is

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

What are server-side dynamic pages?

A

The pages are dynamically changed by the web server. So instead of fetching an existing HTML file, the server can generate a new web page.

ex. Google search or Amazon search - like a very advanced version of VLOOKUP

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

List some examples of dynamic elements on a product page like Amazon.

A
  • price (depends on time of day and stock of item)
  • customer feedback/reviews (depends on activity of previous customers
  • list of similar items

Elements can also be specific to the viewer:

  • recommended items
  • number of items in cart
  • price depending on region
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are client-side dynamic pages?

A

The pages are dynamically changed by the web browser. In addition to the HTML, a web page can contain code written in programming language (ex. JavaScript) which is good for manipulating pages. The client will interpret then execute the code.

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

When using a dynamic element like a button, what does numclicks do?

A

It stores the number of times a button has been clicked. The code used will change the numclicks variable to be one larger, then instructs the browser to find the HTML element and display the appropriate number.

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

What are cookies?

A

They are the primary mechanisms that websites use to track user behaviour. When an HTTP request is made, the server sends back additional messages (cookies) that are hidden. The client stores the message until a request is made to the same server again, where the cookie is passed back.

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

What is a pro and a con of cookies?

A

Pro: good for remembering passwords
Con: annoying advertisements based on user behaviour

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

What is a query string?

A

They appear in URLs and are made up of pairs of values each separated by “&” and two values appear in a pair, separated by “=”. In the URL, the query string is everything that appears after the “?”. Both clients and servers can access this information.

ex. http://x.com/content?session=878d294f0d35&referral=alice&course=cs100&page=3&auth=175b929

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

What are examples of what a query string can tell the client or server?

A
  • session number: tracks pages viewed within a site
  • referral: how you arrived at the site
  • authentication code: allows only you to do something (ex. post on FB)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is XML?

A

It is more flexible than HTML and can update through out the day through JavaScript code requests (dynamically adjusts page accordingly).

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

How does JavaScript work (asynchronous communication)?

A

it doesn’t stop to wait for requests to be answered as background communication is allowed w/o slowing down the browser.
ex. used for FB posts/comments & google docs