134-web-technologies Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

HTML (Hyper Text Markup Language) -

A
  • standard markup language for creating n defining web pages.
  • Structural layer, describes structure + order of webpage and the text and images to browser.
  • browser reads, n interpret html tags to render web page visually for viewer
  • HTML document made up of head (contains metadata: title, character set, styles, scripts etc) and body (page contents)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

HTML elements and attributes

A

elements: building blocks of HTML pages, defines web page. Consist of start n end tags. Can have attributes (provides additional info about element) that come in name-value pairs e.g charset=“utf-8” (name=“value”)).

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

HTML tag <html>

A

goes at top of page to let browser know it’s a HTML file. All code written within is interpreted as HTML. Closing tag ends file. <html> </html>

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

HTML tag <link></link>

A

links external CSS file so style can be saved on another sheet (same style sheet can be used for multiple HTML pages). <link rel=“stylesheet” href=“style.css” /> href is the path to file

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

HTML tag <title></title>

A

metadata tag. puts title in browser window bar/tab (not on page) <title> </title>

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

HTML tag <body>

A

main content (headings, paragraphs, images, hyperlinks, tables, lists etc) that’s not metadata. <body> </body>

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

HTML tag <h1> <h2> <h3>

A

heading tags. h1 is the biggest, h6 the smallest. <h1> </h1>

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

HTML tag <img></img>

A

used to import/embed a picture. e.g <img src =“picture.jpg” width=“500px” height=“500px” />

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

HTML tag <head>

A

<head> </head>

container for metadata about the html document

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

HTML tag <a></a>

A

hyperlink to another page <a href=“contactus.html”> Click to contact us! </a>

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

HTML tag <div>

A

used for divisions of areas (like invisible boxes) in a page and can apply different styles to each part e.g borders, background colours for the divs. Can give it a ID to be referenced in JavaScript. E.g id=“mydiv”> Here is a div</div> or <div class=“introclass”>

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

HTML tag <form>

A

to create an input form. <form> <label for=“fname” > first name: </label> <input type=“text” id=“fname” name=“fname” placeholder=“enter name here”> </form> <br></br> can be used inside <form> to create blank lines between input boxes

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

HTML tag <input></input> for form

A
  • <input type=“text”> for single line text input, can replace “text” with “radio” for radio button (for one of multiple choices), or “checkbox” for ticking choices, or “submit” for displaying a submit button, or “button” for displaying a clickable button
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

HTML accessing a input element with type “submit” -

A

var x=document.getElementById(“mySubmit”);

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

HTML tag <p>

A

<p> makes a paragraph with a line space above and below, text is entered between </p>

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

HTML tag <ol>

A

ordered list (basically a list with numbers/alphabets instead of bullet points). Each element in list is defined with <li> tag. E.g <ol> <li> Dog </li> <li> Cat> </li> <li> Mouse </li> </ol> would look like 1. Dog 2. Cat 3. Mouse

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

HTML tag <ul>

A

unordered list (uses bullet points). Each element in list is defined with <li> tag. <ul> <li> Fish </li> <li> Cabbage </li> <li> Duck </li> </ul> would look like • Dog • Cat • Mouse

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

HTML tag


A

for JavaScript code, placed in <head> tag <script type=“text/javascript”> alert(‘test’);

 or if want to link external js file <script src=“/myscript.js”>
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

HTML identity (id) attribute

A

unique id given to an element on a web page to point to a specific style declaration (can only be used by one html element within a page). Or used by JavaScript to access/manipulate the element with the id. defined in head tag or external css file. Uses #. E.g #m1 { color:white; font-family: Arial; background-color:black; } <h1 id=“m1”> testing </h1> the properties of the id are in the { }

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

HTML class attribute

A

can be used by multiple HTML elements. Defined in <head> tag or external css file. Uses the dot: . Example: .m1 { color:white; background-color:black; } <h1 class=“m1” > Hello World </h1>

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

CSS (cascading style sheets)

A
  • describe style of a webpage (tells browser how HTML elements are displayed/presentation layer).
  • uses selectors classes and ids etc
    -to define the formatting of a website
    to change the formatting depending on a device
    to give a consistent look to every page
    to set the formatting
  • if multiple styles have been applied to the same element, it will take on the last style sheet - however, follows a cascading order: all styles in a page will cascade into a new style sheet with inline style being the highest priority, then external/internal style sheets in head, then browser default. Inline has highest priority so will override the external/internal/browser ones on the same element.
  • can be placed within HTML or externally in a file
  • Allows developers to control layout of multiple elements/web pages at once (using ids and class/external css).
  • Forms: inline CSS, internal CSS, external CSS.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

Inline CSS style

A

to apply a unique style for a single element. Defined in body tag. E.g <h1 style=“color:blue; text-align:center;” example</h1> <div style= “border: 1px solid black; color: red”> example </div>

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

Internal CSS style sheet

A

used if a single HTML page has a unique style, but for multiple elements. Defined inside <style> element inside <head> section. E.g <head> <style> body { border:-style:dotted; border-color:blue; } h1 { color:maroon; margin-left: 40px; } </style> </head></style>

24
Q

External CSS style sheet

A

can be used for multiple elements for multiple pages for the same style. Defined inside <head>, external CSS sheet is linked with <link></link> tag . E.g <link rel=“stylesheet” href=“mystyle.css”> mystyle.css could have body { color:#34ee34; } #m1 { font-size:24px; } border:-style:dotted; border-color:blue

25
Q

CSS property background-color

A

sets background colour of an element, can use predefined colpur names or hex values. E.g background-color: #ff33ee or background-color: purple

26
Q

CSS property border-color

A

sets colour of a border. can use predefined colpur names or hex values. Only works if border style is set too. E.g border-color: #ff33ee or border-color: purple

27
Q

CSS property border-style

A

Changes style of a border. Options are solid, dashed, dotted, double, groove, ridge, inset, outset, hidden. E.g border-style: solid;

28
Q

CSS property border-width

A

sets width of border, usually in px (pixels). Need to have border style before using width. E.g border-width: 3px;

29
Q

CSS mixed borders

A
  • a mixed border example: border-style : dotted solid double dashed; (top would be dotted, right is solid, left is double, bottom is dashed). Can be mixed for color and width too and is up to changing 4 sides for each. E.g border-style: solid double (would make top + bottom solid, and right + left double). Border-style: solid double dotted (top think right + left double, bottom dotted).
30
Q

CSS property color

A

e.g sets colour of the text. color:white

31
Q

CSS property font-family

A

sets the font. Can list multiple fonts so if first choice isn’t installed on user’s computer, the fonts cascade down the list and display the one that is. font-family: arial, helvetica

32
Q

CSS property font-size

A

sets size of text. font-size:20px

33
Q

CSS property height

A

sets height of an element. Can be in pixels (px), percentage of the parent (%), relative to the viewpoint (vw) or etc. height: 20%

34
Q

CSS property width

A

sets width of an element. Same as height for what it can be in. width: 200px

35
Q

JavaScript

A

programming scripting language, adds interactivity to web pages (behaviour layer - allows users to interact with page content) Interpreted rather than compiled as runs in a web browser on many different platforms w/ many different CPU architectures (web pages interpreted by browser each time they are loaded). Often used to validate input data on the client computer so local computer can deal with invalid data before it’s sent off to servers, eases load on busy server n reduces web traffic. Can use to calculate and manipulate data too.

36
Q

JavaScript inputting data (php files)

A

<form id=“form1” action=“/action_page.php”> action attribute tells browser to send any submitted form data to a page on server called action_page.php. The pho files handles the server’s processing of the form data.

37
Q

JavaScript inputting data (simple)

A
  • <input type=“text” id=“forename” name=“forename”>
    simple text boxes and buttons defined using input tag and the attribute determines type of input.

Text box: type=“text” and a submit button would be: type=“submit”. Inputs are given an id (variable, can refer to it using JavaScript).

38
Q

JavaScript outputs (method-1 changing the inner HTML of an element)

A

<p id=“example”></p> document.getElementById(“example”).innerHTML=“This is the output”;

39
Q

JavaScript outputs (method 2 - button)

A
  • <button onclick=“myFunction()” > example </button> when clicked, willl trigger the JavaScript code inside the
     tags, the function part tells the browser the name of the JavaScript function that needs to run when button clicked
40
Q

JavaScript outputs (method 2 and 3 - alert box and writing directly)

A

writing directly to the page: document.write(“This is the output”); using an alert box: alert(“This is the output”); or alert(5+6);

41
Q

Search engine

A
  • program, searches through a database of internet addresses looking for resources based on criteria set by client.
    -To make finding info on the web easier.
  • Relies on an index of web pages in order to display web resources the most relevant, high quality, important at the top (as it determines which websites users choose to visit and use)
42
Q

Web crawlers (spiders)

A
  • visits site either by selecting it or from an existing list/following a link. records info such as text, metatags and position of each word within page storing them in an index. follows links to other sites.
  • A program traverses the web by following links on websites and collects keywords and phrases from linked web pages to add to the index.
  • This is used to automate the indexing of websites and continuously update the index by mapping links between pages and collecting metadata.
  • The program adds meta data from websites and creates an entry for each word in the document alongside its position on the page.
  • The search engine looks through this index when searching and returns a list of websites found in its search results.
  • The indexing system consists of keywords, links to websites, and metadata tags implemented by developers.
43
Q

Search engine indexing

A
  • process of search engine analysing, collecting, sorting and storing content of web pages in its index
  • stores indexed content in a database, along with metadata
  • when client submits search via search engine, search engine software runs request against its index and provides results for a search that match the query fast.
44
Q

SEO (search engine optimisation)

A
  • aims to improve rankings of websites in different search engines using…
  • on-page optimisation (code of site optimised to have most effective keywords in the best places so search engines pick them up enter)
  • off-page optimisation (boosting ranking by making blog posts that link to your site, writing articles and getting links from other reputable sites).
45
Q

Penguin algorithm

A

set of rules SEO companies need to follow created by Google. If a site is deemed to be spamming links in attempt to boost ranking, google bans them from their search permanently.

46
Q

Page rank algorithm

A

Page rank algorithm works by= counts number & quality of links to a page, ranks pages on search engines, determines rough estimate of website’s importance & the order pages displayed when a search is conducted. Higher ranked pages show up first. Rank factors: amount of incoming links from other web pages, page rank of the web pages that link to it. assumption: greater importance websites more likely to be linked to from other websites. In the first instance, algorithm makes an informed guess and after several further iterations, begins to home in on the correct PageRank (can be millions of iterations required for final PageRank number to stop moving) once the final PageRank is achieved, the average PageRank of all pages will be 1.

47
Q

Page rank algorithm formula

A

PR(A)=(1-d) +d(PR(T1)/C(T1)+…+PR(Tn)/C(Tn)) - PR(A) is the page rank of page A (the page we’re trying to find). It’s equal to 1 x damping factor divided by number of pages in consideration + damping factor multiplied by the sum of all the page ranks divided by the number of outbound links
C(Tn) is the total count of outbound links from web page n, including the inbound link to page A
Each web page has a notational core of q, shared between all the web pages it links to
PR(Tn)/C(Tn) is the share of the vote Page A gets from page T1 through Tn
Each of these vote fractions are added together and multipled by d

48
Q

Web servers and client/user.

A

server holds webpage/resource user wants. Decisions are made about what processing occurs on the client or server side (based on performance, security, usability)

49
Q

Client side processing

A
  • client connected to a web page processes data on a local device (all info processed on client computer)
  • Data is processed before it is sent to a server by the client.
  • Operations performed by client (computer application e.g web browser that runs on a user’s local computer and connects to a server as necessary) in computer network.
  • On the web, usually happens in the form of scripts and these are executed by the client browser, the web page does not communicate with the server at this point.
  • Client side technologies: HTML, CSS, JavaScript. Examples: drawing webpage on screen and JavaScript interactivity form validation using JavaScript to update the screen.
50
Q

client side processing pros and cons

A

PROS:
- immediate response to user actions, executes quickly, no server communication, data cannot be intercepted
- reduces bandwidth/load (removes potential unnecessary processing) on server and amount of web traffic (having client requests, and travelling between user and server). Initial data validation is done by JavaScript (fast and invalid inputs can be checked and stopped prior to reaching server)
- more interactivity, and control over behaviour and look for developers, can manipulate user interface elements

CONS:
- insecure and can be easily altered so often needs further validation by server if not already rejected
- not all browsers support scripts (as scripts are processed by the client, they are dependent on clients’ machine’s performance + if JavaScript is disabled/browser capability for so)
- source code is visible - allowing it to be copied/modified

51
Q

Server side processing

A
  • processing completed by web server before data is transmitted (client sends data to a server for it to be processed which sends output back to browser after.
  • Sometimes necessary to: process user input (providing another layer of validation), display pages, structure web applications, interact with permanent storage/databases using SQL.
  • client does not always have capability to provide the data required to process a request (company may hold sensitive data relating to the request). Examples: accessing database to check log in details or find a specific resource that has been requested.

Server side languages e.g: PHP, Perl, Python, Node.js and ASP.Net.

52
Q

server side processing pros and cons

A

PROS:
- doesn’t require plugins, can perform large and complex calculations much faster than clients
- additional further server-side validation for data submitted by client that can’t be done on client side - to ensure accurate secure data being transmitted ( prevent malicious code such as SQL injection/XSS) as client side can be modified
- keeps organisation data secure (stuff only done on server side, queries and isolates server database) and encodes data into readable HTML
- takes away reliance of needing to have browser having the correct interpreter and not browser dependent.
- more secure, it hides the code from the user - protecting copyright and avoiding it being amended/circumvented

CONS:
- puts extra load on the server

53
Q

Cookies

A

data files used to personalise a user’s experience on a web site. stored on client side

54
Q

damping factor

A

value between 0 and 1
probablity that a user will not follow a link
d is the damping factor that prevents PR(Tn)/C(Tn) from having too much influence
It is notionally set to 0.85, which equates to roughly six clickthrough links, the average user will end their browsing session or enter a new web address rather than following another link.

55
Q

how can a website be made accessible

A

text alternative for images e.g alt attribute with img tag if user disabled images/image does not load.

changing styles using css, have multiple external style sheets so page look can be switched e.g layout for smaller devices or increasing font size and contrast of colours for visually impaired
JS to allow users to switch style sheets without having to reload the page
-culutural meanings of colurs
-unicode supports all character sets.
avoiding combining colours that may be indistinguishable by those with colour blindness

use character sets and fonts that support different alphabets
use server side processing to amend content shown
writing web page to facilitate screen readers e.g giving hyperlinks meaningful names
using tables for tabular data as they are intended and not layout to aid screen readers
ensuring all content can be accessed with the keyboard alone
avoiding captcha