Section 1

Preview this deck

How should passwords be stored?

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

0

All-time users

0

Favorites

0

Last updated

6 years ago

Date created

Mar 1, 2020

Cards (21)

Section 1

(21 cards)

How should passwords be stored?

Front

They should be stored with a hashing function; whenever the user enters their password to access the system that is also hashed and the two hash numbers compared. Salt should be added to the passwords in order to make the passwords more secure by adding random text to the original string. This salt must be stored to be used when comparing the user's password to that stored in the system.

Back

What is a session?

Front

Uses a cookie to find data associated with a specific user, that is stored on the server.

Back

What is a cookie?

Front

A small piece of data sent by the server and returned to the server with client requests.

Back

Discuss two problems with AJAX.

Front

JS can be disabled by the user so AJAX calls will not work. To resolve this, the page should provide a mechanism for reloading the page conventionally if it is detected that javascript is unavailable. The user cannot tell that the page content is loading. Use javascript to modify the CSS so that the page visibly changes until the content has loaded ( eg. a loading pinwheel ).

Back

Explain the process and importance of form validation.

Front

Validation is important to ensure invalid data does not reach the database. A form should validate the format of the data ( and return the user to the form if it is found to be invalid. ). but cannot verify the correctness of the data. Validation can take place both on the client and server.

Back

What should be considered when choosing elements for a HTML form?

Front

Text fields should be avoided where possible; rather, the form should use elements that reflect the type of data they will be used to collect, will minimise the potential for user error and can be used to efficiently validate the data.

Back

What is SVG and how is it used within D3?

Front

Scalable vector graphics is used to specify graphics using XML. D3 uses it to render visualisations within a browser as it can be easily added to the document object model. SVG can be styled with CSS to give a visualisation a uniform look and feel that matches the website.

Back

Form validation is a common task carried out by JavaScript programs. Given a form containing a text area, outline the steps with which the program can confirm that the text area does not contain more than 2000 characters.

Front

A function is attached to the form's 'onsubmit' event which executes once the the submit button is pressed but before the form data is sent to the server. The form element's value is extracted ( using the DOM ), and a check is made to see if it is longer than 2000 chars. If it is not, the form data is sent. if it is, the function returns false and the suer is returned to the form.

Back

For a ticket purchasing site, discuss whether is would be more appropriate to use HTTP or HTTPS as the communication protocol between the client and server.

Front

The users are purchasing tickets, so credit card details will be exchanged between the client and server; thus makes sense to transmit the data with HTTPS. Transmitting with HTTP alone is vulnerable to a man-in-the-middle attack as it is transmitted in an unencrypted form. HTTPS transmitted messages are encrypted with SSL or TLS so if the message is intercepted it cannot be read.

Back

What is the purpose of AJAX?

Front

AJAX facilitates the refreshing of content without reloading the page. It uses asynchronous call to a server to obtain the new content which can be added to the document object model once the data is all received.

Back

Discuss the relevance of frameworks such as D3 to the modern World Wide Web.

Front

With the explosion of data that has occurred online in recent years there is more data to be presented than can reasonable be done using tables. D3 provides a rance of techniques for visualising data. It facilitates interaction, meaning users can tailor a visualisation for their own needs and is well suited to use in a browser given it's reliance on SVG.

Back

In Javascript, what is hoisting?

Front

Hoisting allows a variable to be declared after it is used by moving all variable declarations to the top of the JavaScript code before it is executed. Only declarations are hoisted, not initialisations.

Back

an element is to be rotated by 90 deg when the mouse passes over it. The rotation should take 3 seconds. CSS:

Front

#myelem { transition: transform; transition-duration: 3s; } #myelem : hover { transform: rotate(90deg); } The rotation is specified using the transform property and setting a rotation of 90deg. The rotation is activated using the :hover pseudo-class. The transition is attached to the transform property. The transition duration is set to 3s.

Back

What is meant by responsive web design? which is it important? how is it facilitated by CSS?

Front

Responsive web design is important because it enables the same website to be viewed on different devices without requiring the implementation of a separate website. Media queries are used to facilitate responsive web design, using break points to identify conditions under which the page's layout no longer works and providing a style to cope with this problem. Strategies such as removing large images and preferring flexible grid layouts are used to enable the smooth transition from a large screen to a small screen.

Back

Suggest a way that prevents users from having to log in each time they visit the website.

Front

The system should use a session which would store a cookie in the browser to identify the user that can be returned to the user when they request another page. The user ID can be used to load session data stored on the server including the fact they are logged in.

Back

What are semantic elements in HTML5? How does their use improve accessibility of websites?

Front

HTML5 provides semantic elements whicha re named so that they describe their content. This means that a screen reader can easily parse the page and identify which elements should be read out to a partially sighted user. A screen reader cannot make such distinctions between non-semantic elements such as divs.

Back

A JavaScript program is to present data describing iris flowers. An iris has a name ( a name ), a sepal length ( an integer ) and a petal length ( an integer ) . Write a constructor to instantiate such an object, and show how the constructor would be used.

Front

function Iris(name, sepal, petal) { this.name = name; this.sepal = sepal; this.petal = petal; } var flower = new Iris("My Iris", 2, 3);

Back

In HTML, what is a replaced element and a non-replaced element? examples.

Front

A replaced element fetches its content as the page is loaded ( eg. an image. ) A non-replaced element contains it's data within the HTML ( eg. div tag )

Back

Provide examples of the following types of CSS selector: ID, class, pseudo-class, pseudo-element.

Front

#myid .my_class :hover ::first-child

Back

What are the components of the MVC architecture, and why is it useful in web application development?

Front

Model - responsible for database access. View - data presentation Controller - data processing MVC supports decoupling which reduces dependencies between different components of the system.

Back

What is a javascript event? discuss why events are useful and outline their basic components.

Front

An event is used to signal a JavaScript program that something has happened so that the program can respond to it. The basic components are: the event target which is an object that the event is associated with; the event handler, the function that is run when the event is detected; and the event object which is an object passed to the event handler and describes the specific event that has occurred. They are useful ebcause they facilitate various aspects of client side web programming ( eg. such as allowing interaction or facilitating communication with a server using AJAX).

Back