HTML Flashcards

1
Q

What are the main components of a URL?

A

order of URL = protocol://domain:port/path/filename

◦ protocol defines the communication mechanism to be used to retrieve the resource (the format of messages sent back and forth, rules for handling messages)
◦ domain identifies who to contact to retrieve the resource
◦ port identifies the particular network port that we expect whatever will handle a request to be listening to
◦ path is just like a directory/folder path in a hierarchical filestore and identifies where the resource is located
◦ filename is the actual name of the file that we are describing

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

Do you need to use a full URL for everything?

A

A full URL (protocol + server + path + filename) isn’t always
necessary or desirable
If you are pointing to something (page, image, video etc) on the
same server then you can use a relative link
The browser will get the missing information from the current HTML
document (the Base URL)

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

Why use relative Links?

A

Makes HTML smaller
◦ Faster to write
Allows content to move around a web server/ web servers
◦ If the pages don’t have the server address in their HTML then they can be on
any part of any server and will not require editing of the URLs in the href
attributes of aelements
(As long as the hierarchy of files and directories remains the same)
◦ Often a group of pages will all use relative linking and may be moved together
as a block

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

is Hot Linking bad practice?

A

Yes…

Hotlinking (also called inline linking, direct linking, leeching) is where◦ you include a link to a resource on someone else’s site in your page
◦ and consequently cause the resource to be loaded from the other server
Commonly occurs with images
I did this in the example from last week:◦ <img></img>
◦ Everytime someone views my webpage, wikimedia.org will pay for the cost of the image being downloaded.
A more polite approach would have been to save the image locally to my website first, e.g. calling it images/lennon.jpg, then make this the link:◦ <img></img>

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

What are the HTTP Request Types?

A

GET ◦ requests a resource (hypertext document, image, etc) identified by URI
HEAD ◦ is identical to GET, except that only the header is returned (useful when only metadata like the Etag is needed)
POST◦ modifies an entity with existing URI on the server according to the data in the response body (e.g. useful when posting a comment to an article)
PUT◦ adds a new entity identified by a URI to the server (e.g. a new article with its own URI) or replaces one with the same URI
DELETE◦ deletes an entity identified by the URI on the server
More commands exist: TRACE, OPTIONS, CONNECT, PATCH

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

Difference Between GET and POST requests?

A

GET requests can be cached, remain in browser history, can be bookmarked, are insecure, and have restricted length

Post requests are never cached, do not remain in browser history,
cannot be bookmarked and have no length restrictions!

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

What are examples of good uses for HTML Forms?

A
login details (username + password)
◦ registration details (name, contact info etc) 
◦ preferences for using the site
◦ entering search queries
◦ payment info for online purchases
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are fieldsets?

A

Are used to add visual structure to forms
Provide labeling and visual grouping of form content
Contains a legend element in their content
Normally contain input controls

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

an input element with the type attribute set to password would do what?

A

like type=”text” except that the text is obscured in some way e.g ***
the browser is responsible for obscuring the text

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

What does the reset element do within a form?

A

when clicked all form controls are reset to their initial values
◦ the browser handles this

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