IT8501

Web Technology

7 Files
•
CSE Department
Download Progress 0/7 files
Unit 1
Notes Not downloaded 5.6 MB
Unit 2
Notes Not downloaded 2.8 MB
Unit 3
Notes Not downloaded 2.1 MB
Unit 4
Notes Not downloaded 1.5 MB
Unit 5
Notes Not downloaded 1.2 MB
Important Questions
Study Not downloaded 353 KB
Question Paper
Exam Not downloaded 653 KB
Academic Study Guide

Web Technology & Full Stack Engineering Comprehensive Guide

Web Technology encompasses the client-side and server-side software engineering principles underpinning modern distributed internet applications. This guide provides in-depth academic notes on semantic HTML5, modern CSS3 layouts (Flexbox and Grid), asynchronous JavaScript (ES6+, Promises, async/await), HTTP protocol and RESTful API architecture, client-server security (CORS, CSRF, XSS), and database integration.

Unit-by-Unit Theoretical Revision

Unit 1: Semantic HTML5, CSS3 & Responsive Design

Web interfaces rely on standard markup and declarative stylesheet engines to structure and render accessible visual documents.

  • HTML5 Semantic Elements: <header>, <nav>, <main>, <section>, <article>, <aside>, and <footer>. Enhances screen reader accessibility, browser parsing, and search engine optimization (SEO) indexing hierarchy.
  • CSS Box Model: Content box → Padding → Border → Margin. Controlled via box-sizing: border-box ensuring declared width encompasses padding and border dimensions.
  • Modern CSS Layout Systems:
    • CSS Flexbox: 1-dimensional flow layout managing alignment, distribution, and wrapping along main-axis and cross-axis (justify-content, align-items).
    • CSS Grid: 2-dimensional grid system defining explicit rows and columns using fractional units (fr), track sizing (repeat(auto-fit, minmax(...))), and template areas.
  • Responsive Web Design: CSS Media Queries (@media (max-width: 768px)), fluid typography using clamp(), and viewport meta tag configuration.

Unit 2: Modern JavaScript (ES6+), DOM & Event Architecture

  • Variable Scope & Hoisting: var (function scoped, hoisted with undefined), vs let and const (block scoped, temporal dead zone preventing pre-declaration access).
  • Document Object Model (DOM) Manipulation: DOM tree traversal (querySelector, createElement, appendChild) and document fragments for batched high-performance DOM updates.
  • JavaScript Event Model: Event Flow phases: Capturing phase (window to target) → Target phase → Bubbling phase (target propagating back to window). Controlled via event.stopPropagation() and event.preventDefault(). Event Delegation attaches a single listener to a parent element to handle events on dynamic child nodes.

Unit 3: Asynchronous JavaScript, Promises & AJAX

  • JavaScript Concurrency Model: Single-threaded runtime powered by an Event Loop, Call Stack, Web APIs, Microtask Queue (Promises, MutationObserver), and Macrotask Queue (setTimeout, setInterval, I/O). Microtasks execute before next macrotask.
  • Promises & Async/Await: A Promise represents an asynchronous operation with states: Pending, Fulfilled, or Rejected. Handled via .then()/.catch() or modern synchronous-style async/await syntax with try...catch error handling.
  • Asynchronous Data Fetching: Fetch API sending HTTP requests with Promise-based JSON payload parsing (fetch(url).then(r => r.json())).

Unit 4: HTTP Protocol, REST Architecture & Server-Side Concepts

  • HTTP Methods & Idempotence: GET (safe, idempotent, retrieves resource), POST (non-idempotent, creates resource), PUT (idempotent, completely replaces resource), PATCH (partially updates resource), and DELETE (idempotent, removes resource).
  • HTTP Status Codes: 2xx Success (200 OK, 201 Created), 3xx Redirection (301 Moved Permanently, 304 Not Modified), 4xx Client Errors (400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found), and 5xx Server Errors (500 Internal Error, 503 Service Unavailable).
  • REST Architectural Constraints: Client-Server separation, Statelessness, Cacheability, Uniform Interface (resource identification, self-descriptive messages, HATEOAS), Layered System, and Code on Demand.

Unit 5: Web Security & Client-Side Storage

  • Cross-Site Scripting (XSS): Malicious script injection into web pages. Types: Stored XSS, Reflected XSS, and DOM-based XSS. Mitigated by context-aware HTML output encoding and strict Content Security Policy (CSP) headers.
  • Cross-Site Request Forgery (CSRF): Unauthorized commands transmitted from a trusted user. Mitigated via anti-CSRF synchronizer tokens and SameSite cookie attributes (SameSite=Strict/Lax).
  • Cross-Origin Resource Sharing (CORS): Browser security mechanism enforcing Same-Origin Policy (SOP). Server authorizes cross-origin access via HTTP headers: Access-Control-Allow-Origin, Access-Control-Allow-Methods, and preflight OPTIONS requests.
  • Client-Side Storage: Cookies (4 KB, sent with every HTTP request), LocalStorage (5-10 MB, persistent key-value), SessionStorage (tab lifetime), and IndexedDB (transactional NoSQL database for large offline assets).

Client-Side Storage Comparison

Storage Mechanism Storage Capacity Lifetime / Expiration Transmitted in HTTP Headers? Best Used For
Cookies~4 KBConfigurable via Expires / Max-AgeYes (Every request)Authentication tokens (HttpOnly)
LocalStorage~5 - 10 MBPersistent until manually deletedNoUser theme settings, cached UI state
SessionStorage~5 MBCurrent browser tab sessionNoMulti-step form wizard data
IndexedDB> 250 MB+PersistentNoOffline PWAs, large datasets, documents

High-Frequency University Exam Questions

Q1: Explain Event Bubbling and Event Capturing in the JavaScript DOM event flow.

When an event occurs on a DOM element, the event flow executes in three distinct phases: (1) Capturing Phase: The event travels downward through the DOM hierarchy from the window and document objects down to the target element's parent. (2) Target Phase: The event reaches and fires on the target element itself. (3) Bubbling Phase: The event bubbles back upward from the target element through all its ancestor elements to the window. Developers can register listeners for either phase using addEventListener(event, handler, useCapture); passing false (the default) captures during bubbling.

Q2: What is the JavaScript Event Loop and how does it prioritize microtasks versus macrotasks?

JavaScript executes synchronously on a single thread using a Call Stack. Asynchronous tasks are delegated to browser Web APIs. When complete, their callbacks enter queues: Microtasks (Promises, queueMicrotask) have higher priority than Macrotasks (setTimeout, setInterval, I/O events). After the Call Stack empties, the Event Loop processes all available microtasks until the microtask queue is completely exhausted before moving on to execute a single macrotask.

Q3: Explain the Same-Origin Policy (SOP) and how Cross-Origin Resource Sharing (CORS) relaxes it.

The Same-Origin Policy is a fundamental browser security boundary restricting documents loaded from one origin (combination of protocol, domain, and port) from reading or interacting with resources from another origin. CORS relaxes this policy securely by allowing servers to declare allowed origins using HTTP response headers such as Access-Control-Allow-Origin: https://trusted.com. For non-simple HTTP requests (PUT, DELETE, custom headers), the browser first dispatches an HTTP OPTIONS preflight request to verify server authorization before executing the actual request.