Comprehensive Study Guide for Web Technology 511

Institutional Information and Module Context

The Web Technology 511511 module is a foundational component of the Information Technology faculty at Richfield Graduate Institute of Technology (Pty) Ltd. This institution is registered with the Department of Higher Education as a Private Higher Education Institution under the Higher Education Act of 19971997, holding Registration Certificate No. 2000/HE07/0082000/HE07/008 and Registration Number 2000/000757/072000/000757/07. The module is designed to bridge academic learning with real-world applications, aligning with industry standards from global tech leaders such as Oracle, AWS, and IBM. The curriculum serves as a prerequisite for Web Technology 512512 and is essential for students in programs like the Higher Certificate in Information Technology (HCIT), Diploma in Information Technology (DIT), and Bachelor of Science in Information Technology (BSc IT), preparing them for roles like IT Support Technicians and Junior Web Developers. The core text utilized is "Web Development and Design Foundations with HTML5, Global Edition," 9th9th edition, by T.A. Felke-Morris (20212021).

Foundations of Internet and Web Technologies

The Internet is defined as a global network of interconnected computers intended for the sharing and transfer of data. It originated from the ARPANET project in the late 1960s1960s, initially serving government and research institutions, before becoming publicly accessible in the 1990s1990s. The World Wide Web (WWW) was created by Tim Berners-Lee in 19891989 and operates as a service on top of the Internet, utilizing Hypertext Markup Language (HTML) to link documents through clickable hypertext. While the Internet is global and unrestricted, organizations utilize Intranets and Extranets for controlled communication. An Intranet is a private, internal network confined to a business, protected by firewalls, and accessible only to authorized personnel. An Extranet extends this by allowing secure sharing of specific network parts with external stakeholders like suppliers or vendors. These secure networks utilize technologies such as Digital Certificates for identity verification, Encryption for data integrity, and Virtual Private Networks (VPNs) to create secure tunnels over public networks.

Network Architecture and Internet Protocols

Networks are classified by their geographic reach, specifically Local Area Networks (LANs) for single buildings and Wide Area Networks (WANs) for cities or countries, with the Internet being the world’s largest WAN. Every device is identified by a unique IP (Internet Protocol) address. The client-server model is the fundamental operating paradigm where a client, such as a web browser, sends an HTTP request (e.g., GET/index.htmlHTTP/1.1GET /index.html HTTP/1.1) to a server, which then provides the requested resources. Internet protocols are standardized rules for data exchange. The Internet Protocol (IP) at the network layer utilizes two versions: IPv4 (32bit32-bit addresses) and IPv6 (128bit128-bit addresses). Transmission Control Protocol (TCP) ensures reliability by dividing messages into packets with sequence numbers and checksums for reassembly. Other key protocols include File Transfer Protocol (FTP) for moving files, Simple Mail Transfer Protocol (SMTP) for outgoing email, Post Office Protocol (POP3POP3) for single-device email retrieval, and Internet Message Access Protocol (IMAP) for cloud-based, multi-device email management. Hypertext Transfer Protocol (HTTP) enables resource retrieval, while HTTPS provides encryption for security.

URIs, Domain Names, and Markup Languages

A Uniform Resource Identifier (URI) uniquely identifies web resources, with the most common type being the Uniform Resource Locator (URL). A URL typically comprises a protocol (e.g., httpshttps), a domain name (e.g., www.richfield.ac.zawww.richfield.ac.za), and a path (e.g., /home/home). The Domain Name System (DNS) maps human-readable domain names to numerical IP addresses. Top-Level Domains (TLDs) are managed by IANA and ICANN, split into generic TLDs (gTLDs like .com.com, .org.org, .edu.edu, .gov.gov) and country-code TLDs (ccTLDs like .fr.fr, .de.de, .jp.jp, .io.io). Data is structured using markup languages: HTML for web page creation; XHTML for a stricter XML-based version of HTML; and HTML5, the latest standard introducing semantic elements like article\langle article \rangle and header\langle header \rangle. Extensible Markup Language (XML) is a flexible format developed by the W3C to separate data from its presentation via custom tags.

HTML Basics and Document Structure

HTML (Hypertext Markup Language) uses tags to define the structure of web content. A document must begin with a Document Type Definition (DTD), which in HTML5 is the concise . The basic template includes the html\langle html \rangle tag to define the language and document boundaries, the head\langle head \rangle section for metadata, and the body\langle body \rangle section for visible content. The head\langle head \rangle includes the title\langle title \rangle tag for browser tabs and SEO, and meta\langle meta \rangle tags for character encoding (e.g., charset="UTF8"charset="UTF-8") and descriptions. Heading elements range from h1\langle h1 \rangle (highest importance) to h6\langle h6 \rangle. Content is further structured using p\langle p \rangle for paragraphs, br\langle br \rangle for line breaks, and blockquote\langle blockquote \rangle for long quotations. Phrase elements like strong\langle strong \rangle and em\langle em \rangle provide emphasis. HTML also supports special characters such as the Copyright symbol (\©), Ampersand (\&), and Greek letters like Alpha (\α).

Lists, Structural Elements, and Hyperlinks

HTML provides three types of lists: Ordered Lists (ol\langle ol \rangle) with numbered items (li\langle li \rangle), Unordered Lists (ul\langle ul \rangle) with bulleted items, and Description Lists (dl\langle dl \rangle) consisting of terms (dt\langle dt \rangle) and descriptions (dd\langle dd \rangle). Modern HTML5 semantically organizes pages using header\langle header \rangle for introductory content, nav\langle nav \rangle for navigation blocks, main\langle main \rangle for primary content, section\langle section \rangle for related content groups, and footer\langle footer \rangle for closing information. Hyperlinks are created using the anchor element (a\langle a \rangle). Hypertext references (hrefhref) can point to internal pages, external websites (using target="blank"target="_blank" to open in new tabs), specific page fragments (using #id), or protocols for communication like tel:+tel:+ for phone numbers and mailto:mailto: for email addresses. The relrel attribute identifies document relationships, such as rel="nofollow"rel="nofollow" or rel="external"rel="external".

Multimedia and Image Optimization

Images are implemented with the img\langle img \rangle element, requiring the srcsrc (path) and altalt (accessibility description) attributes. Optimization involves choosing formats like JPEG for photos and PNG for transparency, while newer formats like WebP offer superior compression. Responsive images use the picture\langle picture \rangle element and srcsetsrcset to serve different resolutions based on device width. HTML5 natively supports audio\langle audio \rangle and video\langle video \rangle without external plugins, featuring attributes like controlscontrols, autoplayautoplay, looploop, mutedmuted, and posterposter. For accessibility, the track\langle track \rangle element provides subtitles. Efficiency is enhanced through the loading="lazy"loading="lazy" attribute, which defers loading until the asset enters the viewport, and decoding="async"decoding="async" for non-blocking image rendering.

Cascading Style Sheets (CSS) Concepts

Introduced by the W3C in 19961996, CSS separates a web page's presentation from its content. CSS2 (19981998) introduced element positioning, while CSS3 added features like rounded corners and transparency. Styles are applied via four methods: Inline (using the style attribute), Embedded (within style\langle style \rangle tags in the head), External (linked via link\langle link \rangle in the head), and Imported (using the @import@import directive). A CSS rule consists of a selector (targeting an HTML element, class, or ID) and a declaration (the property and value). Colors can be named, specified via RGB, or defined using Hexadecimal values (090-9, AFA-F, base-1616). Examples include Red (#FF0000) and Blue (#0000FF). The textshadowtext-shadow property allows for horizontal and vertical offsets, blur radius, and color to add depth to typography.

CSS Box Model and Page Layout

The CSS Box Model defines every element as a rectangular box consisting of four areas: Content (text and images), Padding (space between content and border), Border (surrounds padding), and Margin (empty space between elements). By default, the contentboxcontent-box model calculates size based only on content, whereas setting boxsizing:borderboxbox-sizing: border-box includes padding and borders in the specified width. Page layout follows a Normal Flow: block-level elements (e.g., div\langle div \rangle, p\langle p \rangle) stack vertically and take full width, while inline elements (e.g., span\langle span \rangle, a\langle a \rangle) flow horizontally. The floatfloat property permits elements to be moved left or right with content wrapping around them, while the overflowoverflow property manages content that exceeds container dimensions. Interactive states are styled using pseudo-classes: :hover:hover (mouse hover), :focus:focus (active input), and :active:active (during element activation).

HTML Tables and Interactive Forms

HTML tables (table\langle table \rangle) organize data into rows (tr\langle tr \rangle) and cells (td\langle td \rangle for data, th\langle th \rangle for headers). Advanced structure involves the thead\langle thead \rangle, tbody\langle tbody \rangle, and tfoot\langle tfoot \rangle tags, with attributes like colspancolspan and rowspanrowspan to merge cells. Forms (form\langle form \rangle) serve as the bridge for user interaction, requiring an actionaction attribute to specify data destination and a methodmethod (usually GETGET or POSTPOST). Common form controls include input\langle input \rangle with types like texttext, emailemail, passwordpassword, radioradio (single selection), checkboxcheckbox (multiple selection), and submitsubmit. Specialized HTML5 inputs include teltel, urlurl, datedate, and rangerange. Labels (label\langle label \rangle) are used for accessibility, and related elements are grouped using fieldset\langle fieldset \rangle and legend\langle legend \rangle.

JavaScript Core and Document Object Model (DOM)

JavaScript is an object-based, client-side scripting language interpreted by the browser. It is used for alert messages (via the alert()alert() method), popup windows, and form validation. Code is enclosed in script\langle script \rangle tags. The Document Object Model (DOM) treats the browser window, document, and elements as objects with properties and methods. Property examples include document.titledocument.title and document.bgColordocument.bgColor. Access methods include getElementById()getElementById(), getElementsByClassName()getElementsByClassName(), and querySelector()querySelector(). Browsers detect events (actions by the visitor) such as onclickonclick, onloadonload, onmouseoveronmouseover, and onmouseoutonmouseout. Event handlers (prefixed with "on", like onsubmitonsubmit) designate specific code to execute when these events are triggered.

Programming Concepts and Functions in JavaScript

JavaScript utilizes variables declared with varvar, letlet (block-scoped), or constconst (immutable). Variable names must start with a letter, _ , or $\$. Data types are divided into Primitives (String, Number, Boolean, Undefined, Null) and Composites (Object, Array, Function). Arithmetic operators include addition (++), subtraction (-), multiplication (×\times), and division (//). Decision making is handled by the ifif control structure, using comparison operators like equality (====), strict equality (======), and logical operators (&&\&\& for AND, || for OR). Functions are blocks of code defined with the functionfunction keyword to perform specific tasks. Arrays are complex variables that store multiple values indexed from 00 to n1n-1. Form handling often involves the onsubmitonsubmit event, which can return falsefalse to halt submission if validation fails.

The jQuery Library

Developed by John Resig in 20062006, jQuery is a JavaScript library designed to simplify tasks like DOM traversal and event handling. It ensures cross-browser compatibility and supports Asynchronous JavaScript and XML (Ajax) for dynamic content updates without page reloads. The library can be included locally or via a Content Delivery Network (CDN). The basic syntax uses the $()\$() function as a selector. Common jQuery selectors include the wildcard selector (*), element selectors (pp), ID selectors (#id), and class selectors (.class.class). Chained methods enable quick modifications, such as .css().css() for style changes, .hide().hide() and .show().show() for visibility, and .fadeIn().fadeIn() or .fadeOut().fadeOut() for opacity animations. The .val().val() method retrieves form data, while .append().append() adds content to elements.

Web Performance Optimization (WPO)

Web Performance Optimization (WPO) focuses on reducing load times to improve user satisfaction and SEO. Even a 100millisecond100-millisecond delay can negatively impact conversion rates. WPO strategies include minimizing HTTP requests and server response times. Images are optimized through resizing and intelligent compression (lossy or lossless). Lazy loading defers the loading of non-critical assets using the Intersection Observer API. Performance is monitored using browser developer tools and metrics like First Contentful Paint (FCP), Largest Contentful Paint (LCP), and Time to First Byte (TTFB). Performance testing categories include Load Testing (normal/peak loads), Stress Testing (extreme workloads), Soak Testing (long periods), Spike Testing (sudden increases), and Scalability Testing.

Caching Strategies and Web Promotion

Caching stores frequently accessed data in a high-speed repository to reduce server load and bandwidth usage. Types include Browser Cache, Proxy Cache, CDN Cache, and Server Cache. Common patterns are the Cache-Aside Pattern (data sought in cache first), Write-Through (simultaneous write to cache and DB), and Read-Ahead (proactive preloading). Service Workers can be implemented in JavaScript to handle site cache (sitecachev1site-cache-v1). Web promotion relies on search engines which consist of three components: Robots (spiders that crawl the web), the Index (database of information), and the Search Form (user interface). Over 90%90\% of adult internet users rely on search engines, with 59%59\% using them on a daily basis.

Questions and Discussion

  1. What is the fundamental difference between the Internet and the World Wide Web? The Internet is the physical network infrastructure, while the Web is an information service operating through HTML and URI protocols on that infrastructure.

  2. Explain the Client-Server interaction for loading a page. The client (browser) sends a request (GET) to an IP address identified by the DNS. The server processes this and returns HTML, CSS, and JS files for the browser to render.

  3. Define the role of the Box Model in CSS. It defines the layout of every element as a rectangular area with content, padding, border, and margin, essential for determining the total width and height of an element on a page.

  4. What are the benefits of semantic HTML5? It improves accessibility for screen readers, enhances SEO for search engines, and makes code more readable and maintainable for developers.

  5. How does JavaScript handle form validation? It uses event handlers like onsubmit to trigger functions that check inputs; if criteria aren't met, the function returns false to prevent the form from sending data to the server.

  6. Discuss the advantages of jQuery over standard JavaScript. jQuery simplifies complex tasks with a concise syntax, provides cross-browser consistency, and offers easy methods for animation and Ajax.

  7. Identify the primary goal of WPO. The goal is to enhance speed and efficiency to reduce bounce rates, improve user experience, and increase business conversion rates.

  8. What is the difference between Write-Through and Write-Behind caching? Write-Through writes data to both the cache and the primary source simultaneously for high consistency, whereas Write-Behind writes to the cache first and updates the main source asynchronously for better performance.