Web Technologies Flashcards

1
Q

What does CSS stand for?

A

CSS stands for Cascading Style Sheets.

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

What is the purpose of CSS?

A

CSS is used to specify the styles of a markup document, describing how elements should be displayed.

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

How is a basic CSS rule structured?

A

A basic CSS rule is structured as follows: selector { property-name: value; }.

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

What are the three ways to apply CSS styles to a document?

A

Inline styles, where properties are specified directly in an element’s tag.

Document-level styles, where rules are embedded within the HTML head element.

External style sheets, which are linked to the document using a <link></link> element in the head.

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

What does a ‘#’ (hash) indicate in CSS?

A

A hash indicates an ID selector, used to select a single element with a specific id attribute value.

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

What does a ‘.’ (dot) indicate in CSS?

A

A dot indicates a class selector, used to select all elements with a specific class attribute value.

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

Define the term “cascading” in the context of CSS.

A

In CSS, “cascading” refers to the way styles are applied in layers from various sources, where rules from different style sheets might overlap, and the browser assigns them different priorities.

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

What is the order of priority for CSS styles?

A

Inline styles (highest priority).

Document-level styles.

External style sheets (lowest priority).

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

What is SASS and what does it add to CSS?

A

SASS (Syntactically Awesome Style Sheets) is a preprocessor that extends CSS with features like variables, nesting, mixins, and inheritance, making CSS more powerful and maintainable.

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

What is Bootstrap and how is it related to CSS?

A

Bootstrap is a comprehensive CSS framework that incorporates SASS, along with scripting and templates, to create responsive and dynamically styled web applications.

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

What does HTML stand for?

A

HTML stands for HyperText Markup Language.

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

What is the primary purpose of HTML?

A

HTML is used to describe the structure and presentation of web documents readable by humans on the Internet.

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

What is a hypertext document?

A

A hypertext document is text containing hyperlinks to other parts of documents or different documents, which can be activated by clicking.

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

What are the basic components of an HTML document’s structure?

A

An HTML document includes elements defined by tags, attributes within those tags, and the content enclosed by the tags.

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

Describe the basic structure of an HTML element.

A

An HTML element is defined by start and end tags (e.g., <p> and </p>), with the content in between. Attributes within the start tag provide additional settings or information.

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

What is the purpose of the DOCTYPE declaration in HTML?

A

The DOCTYPE declaration is used to specify the version of HTML that the document is using, helping the browser to render the content correctly.

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

What kind of metadata can be included in the <head> section of an HTML document?

A

The <head> section can include metadata like the document’s title, character encoding, styles, scripts, and other resources linked to the document.

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

What is the difference between block-level and inline-level elements in HTML?

A

Block-level elements, like paragraphs and divs, appear on new lines and structure the main content, while inline-level elements, like hyperlinks and spans, flow within text and do not break the line.

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

What is the function of the <a> element in HTML?</a>

A

The <a> element (anchor) defines a hyperlink that links to other documents or parts of documents. It uses the href attribute to specify the link’s destination.</a>

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

Explain the difference between absolute and relative URLs in HTML.

A

Absolute URLs provide a complete path including the protocol and domain, while relative URLs specify a path relative to the current document’s location.

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

How can images be included in an HTML document?

A

Images are included using the <img></img> element, which uses the src attribute to specify the URL of the image and the alt attribute to provide a text alternative for accessibility.

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

What are the two types of lists in HTML and how are they defined?

A

HTML supports ordered lists (<ol>) and unordered lists (<ul>). Items in these lists are marked using the <li> tag.

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

How is a table structured in HTML?

A

A table in HTML is structured using the <table> element, with rows defined by <tr> tags, header cells by <th> tags, and data cells by <td> tags. Sections like the header, body, and footer of the table are grouped using <thead>, <tbody>, and <tfoot>.

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

What are the purposes of the <form> element in HTML?

A

The <form> element groups input elements where users can enter data. It uses the action attribute to specify the server endpoint receiving the form data and the method attribute to define how data is submitted (get or post).

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

Describe how user input can be captured in HTML.

A

User input in HTML can be captured through various <input></input> types, such as text, button, checkbox, and radio. Each input can have a name which is used when submitting the form.

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

Explain the use of character entities in HTML.

A

Character entities are used in HTML to display special characters that are reserved in HTML syntax, like < (<), > (>), and & (&).

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

What is JavaScript?

A

JavaScript is a lightweight, interpreted programming language that is dynamically typed. It’s used primarily for interactive web applications and is supported by all modern web browsers.

27
Q

What are the basic syntactical elements of JavaScript?

A

JavaScript syntax includes variable declarations and assignments, conditional statements (like if and else), loops (such as for and while), functions, and object-oriented features like prototype-based inheritance.

28
Q

How can JavaScript be included in HTML documents?

A

JavaScript can be included directly within an HTML document using

 tags or linked externally using 
.
29
Q

Describe two types of loops in JavaScript and their uses.

A

JavaScript supports for loops, which execute a block of code a fixed number of times, and while loops, which execute as long as a specified condition remains true.

30
Q

What is the purpose of conditional statements in JavaScript?

A

Conditional statements like if and else allow JavaScript to execute different blocks of code based on whether a condition is true or false.

31
Q

Describe how the prompt dialog function works in JavaScript.

A

The prompt function displays a dialog with a text input field and OK/Cancel buttons. It takes a message as a string argument and an optional default value. It returns the input as a string, or null if Cancel is pressed.

32
Q

What is the significance of JavaScript being dynamically typed?

A

JavaScript is dynamically typed, meaning variable types don’t need to be declared and can change at runtime. This allows for more flexibility in coding but requires careful management to avoid type-related errors.

33
Q

Explain how JavaScript handles events.

A

JavaScript can respond to user interactions and other events by executing code when these events occur, using event handlers assigned to elements in the HTML.

34
Q

What is the function of the document.write method in JavaScript?

A

The document.write method is used to output HTML content directly into a web page at the point where the script is run in the HTML document.

35
Q

How can you access properties of an event object in JavaScript?

A

Properties of an event object, such as the location of a mouse click, can be accessed within an event handler function using the event parameter provided to the function.

36
Q

What are functions in JavaScript and how do they work?

A

Functions in JavaScript encapsulate code to be executed when called. They are defined using the function keyword, may include a list of parameters, and can return a value. Functions can be called multiple times with different arguments.

37
Q

What is the DOM?

A

The Document Object Model (DOM) is a platform and language-neutral interface that allows programs and scripts to dynamically access and update the content, structure, and style of a document.

38
Q

How is a document represented in the DOM?

A

In the DOM, a document is represented as a tree structure consisting of node objects, which include elements, attributes, and content.

39
Q

How can specific elements be found in the DOM?

A

Specific elements can be located using DOM methods such as getElementById(), getElementsByTagName(), and getElementsByClassName().

40
Q

What are some basic methods provided by the DOM API?

A

The DOM API includes methods like appendChild(), insertBefore(), removeChild(), getAttribute(), and setAttribute() to manipulate the document’s nodes.

41
Q

What property is used to change the content of a DOM node?

A

The innerHTML property is used to change or update the content of a DOM node.

42
Q

How can the styles of an HTML element be changed using the DOM?

A

The styles of an HTML element can be modified using the style property of DOM nodes, which accesses CSS styles applied to the element, allowing changes to individual style properties.

43
Q

How are event handlers specified using the DOM?

A

Event handlers can be added to DOM nodes using the addEventListener method, which takes the name of the event and a function that serves as the event handler.

44
Q

What is jQuery and why is it used?

A

jQuery is a popular JavaScript library designed to simplify HTML DOM tree traversal and manipulation, as well as event handling, CSS animation, and Ajax. It is known for its motto “write less, do more” due to its concise and simplified syntax.

45
Q

How can jQuery be included in a web page?

A

: jQuery can be included in a web page by downloading and linking it as a local script file or by linking to a version hosted on a Content Delivery Network (CDN).

46
Q

Describe how jQuery is used to update content and handle events.

A

jQuery uses the html() method to update the inner content of elements and the val() method for input values. Event handling in jQuery uses methods like click(), where the event handler function is passed as an argument.

47
Q

What does XML stand for and what is its primary purpose?

A

XML stands for eXtensible Markup Language. It is used to represent any kind of structured data in a markup format that is both human and machine-readable.

48
Q

What are the key design goals of XML?

A

The key design goals of XML include simplicity, generality, and usability across different applications and support for a wide variety of human languages.

49
Q

What are the key differences between XML and HTML?

A

Unlike HTML, XML elements and attributes have no predefined meaning and are strictly used as per the application’s needs. XML is case-sensitive and requires correct nesting of elements, whereas HTML is more lenient.

49
Q

How is XML structured?

A

XML documents are structured as elements with content that can include text data and other elements. These elements can have attributes and are defined using start and end tags.

50
Q

What constitutes a well-formed XML document?

A

A well-formed XML document has properly nested elements, begins with an XML declaration, and contains a unique root element. All attributes must be quoted.

51
Q

What is a DTD and what is its role in XML?

A

DTD stands for Document Type Definition. It defines the structure and rules for an XML document, including what elements and attributes are allowed and how they should be nested.

52
Q

How does XML handle data validation?

A

XML uses DTD or XSD (XML Schema Definition) to validate the structure and content of XML documents against defined schemas to ensure they meet specified standards.

53
Q

Give an example of how XML elements can be defined in a DTD.

A

In DTD, an element can be defined with <!ELEMENT name content>, where content can specify types like #PCDATA for text, EMPTY for no content, or ANY for any content.

54
Q

How are attributes defined and used in XML?

A

Attributes in XML are defined using <!ATTLIST element name type value>, where type can be CDATA (string data) or ID (unique identifier), and value can specify default or fixed values.

55
Q

What is the purpose of the XML Schema Definition (XSD)?

A

XSD is used to define XML document structures more rigorously than DTD. It supports data types, namespaces, and is itself formatted in XML, providing a powerful way to ensure XML document validity.

56
Q

What is JSON?

A

JSON stands for JavaScript Object Notation. It is a lightweight, text-based data interchange format that is easy for humans to read and write and for machines to parse and generate.

57
Q

What are the basic data types supported by JSON?

A

JSON’s basic data types include numbers, strings (enclosed in double quotes), Booleans (true/false), and null.

58
Q

What are the compound data types used in JSON?

A

JSON supports two compound data types: arrays (ordered lists of values) and objects (collections of name/value pairs).

59
Q

How are arrays defined in JSON?

A

Arrays in JSON are defined using square brackets [] with elements separated by commas, e.g., [1, “hello”, true].

60
Q

How are objects defined in JSON?

A

: Objects in JSON are defined using curly braces {} with members as comma-separated name/value pairs, e.g., {“name”: “John”, “age”: 30}.

61
Q

What are the primary applications of JSON?

A

JSON is commonly used in web applications for data interchange. It’s used as an alternative to XML, in APIs like JSON-RPC, and data formats in NoSQL databases like MongoDB.

62
Q

How does JSON compare to XML?

A

Both JSON and XML are used to create self-describing hierarchical documents, but JSON is more terse (no closing tags, fewer syntax rules) and directly supports arrays, unlike XML.

63
Q

How can JSON be parsed in JavaScript?

A

JSON can be parsed in JavaScript using the JSON.parse() method, which converts JSON string data into native JavaScript objects.

64
Q

How can JavaScript objects be converted to JSON?

A

JavaScript objects can be converted to JSON using the JSON.stringify() method, which creates a JSON string representation of the JavaScript object.