| Aspect | HTML 4.0 | HTML 5.0 |
|---|---|---|
| Doctype Declaration | Long and complex: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> |
Simple and short: <!DOCTYPE html> |
| Multimedia Support | Required third-party plugins like Flash, Silverlight for audio/video | Native support via <audio> and <video> elements |
| Semantic Elements | Limited semantic meaning, mostly used <div> and <span> |
Rich semantic elements: <header>, <footer>, <article>, <section>, <nav>, etc. |
| Graphics | No native drawing capabilities, relied on images or plugins | <canvas> for 2D drawing and SVG for vector graphics |
| Form Controls | Basic input types: text, password, checkbox, radio, submit | New input types: email, url, date, time, number, range, color, search |
| Storage | Only cookies with limited storage (4KB) and security issues | localStorage, sessionStorage (5-10MB), IndexedDB for structured data |
| Geolocation | Not supported | Built-in geolocation API to detect user location |
| Web Workers | No support for background processing | Web Workers allow JavaScript to run in background threads |
| WebSocket | Not available, used polling techniques | Full-duplex communication channels over a single TCP connection |
| Accessibility | Limited ARIA support | Improved accessibility with built-in semantic elements and ARIA roles |
Parsing Rules: HTML5 has defined parsing rules for error handling, making it more consistent across browsers. HTML 4 had inconsistent error handling.
APIs: HTML5 introduces numerous JavaScript APIs for drag-and-drop, offline storage, document editing, browser history management, and more.
Mobile Support: HTML5 is designed with mobile devices in mind, supporting touch events and responsive design principles.
HTML5 represents a paradigm shift from document markup to application development. It provides native support for multimedia, improved semantics for better SEO and accessibility, enhanced form controls for better user experience, and numerous APIs for rich web applications. While HTML 4.0 served as the foundation for the early web, HTML5 is essential for modern, interactive, and mobile-friendly web development.
| Parameter | Client-Side Scripting | Server-Side Scripting |
|---|---|---|
| Execution Location | Runs on user's browser (client machine) | Runs on web server |
| Languages | JavaScript, TypeScript, VBScript (legacy) | PHP, Python, Ruby, Java, C#, Node.js, ASP.NET |
| Visibility of Code | Code is visible to users (view source) | Code is hidden from users |
| Security | Less secure - vulnerable to manipulation | More secure - executes in controlled environment |
| Performance Impact | Uses client resources, reduces server load | Uses server resources, increases server load |
| Response Time | Faster response for user interactions | Slower due to network round-trip |
| Browser Dependency | Depends on browser capabilities and settings | Independent of browser (except for output) |
| Primary Use Cases | UI validation, animations, DOM manipulation, form validation, interactive content | Database operations, user authentication, file processing, business logic, API endpoints |
| Access to Resources | Limited to browser APIs (no direct file system or database access) | Full access to server resources (files, databases, other services) |
| State Management | SessionStorage, LocalStorage, Cookies | Session variables, server-side caching, database |
Definition: Client-side scripting refers to scripts that are executed by the user's web browser. These scripts are embedded within or referenced from HTML documents and are downloaded from the server along with the web page.
How It Works: When a user requests a web page, the server sends the HTML, CSS, and JavaScript files to the browser. The browser then parses and executes the JavaScript code, manipulating the Document Object Model (DOM) to create dynamic effects.
Definition: Server-side scripting refers to scripts that are executed on the web server before the result is sent to the client's browser. The client receives only the output (usually HTML), not the script itself.
How It Works: When a user requests a page containing server-side code, the web server processes the script, which may include database queries, file operations, or complex calculations. The server then generates HTML output and sends it to the client.
Modern web applications typically use a combination of both client-side and server-side scripting:
Client-side and server-side scripting serve complementary roles in web development. Client-side scripting enhances user experience through responsiveness and interactivity, while server-side scripting handles secure data processing, business logic, and resource management. A well-designed web application strategically uses both approaches to deliver optimal performance, security, and user experience.
$routeProvider is a provider that comes with the ngRoute module in AngularJS. It allows you to define routes for your application, specifying which template (view) and controller should be associated with a particular URL. This enables navigation within a single HTML page without full page reloads, creating a seamless user experience typical of SPAs.
| Property | Description | Example |
|---|---|---|
| templateUrl | URL of the template to load | 'views/home.html' |
| template | Inline template string | '<h1>Home</h1>' |
| controller | Controller to associate with the view | 'HomeController' |
| redirectTo | Redirect to another route | '/dashboard' |
| resolve | Dependencies to inject into controller | {data: function() { return fetchData(); }} |
$routeProvider is a fundamental service in AngularJS that enables the development of Single Page Applications by mapping URLs to views and controllers. It provides a clean separation of concerns, improves user experience with seamless navigation, and allows for deep linking within applications. While newer frameworks have more advanced routing systems, $routeProvider remains an important concept in web development history and is still used in many existing AngularJS applications.
The CSS Box Model consists of four distinct layers that surround an element's content:
| Component | Description | CSS Properties | Effect on Layout |
|---|---|---|---|
| Content | The actual content of the box (text, images, etc.) | width, height | Determines the base size of the element |
| Padding | Space between content and border (transparent) | padding, padding-top, padding-right, etc. | Increases space inside the element |
| Border | Border surrounding padding (visible line) | border, border-width, border-style, border-color | Adds visible boundary around element |
| Margin | Space outside the border (transparent) | margin, margin-top, margin-right, etc. | Creates space between elements |
The total width and height of an element is calculated as follows:
The box-sizing property controls how the total width and height of an element is calculated:
| Value | Description | Width Calculation | When to Use |
|---|---|---|---|
content-box (default) |
Width/height only applies to content | Total width = width + padding + border | Legacy layouts, when precise control is needed |
border-box |
Width/height includes content, padding, and border | Total width = specified width (includes padding and border) | Modern layouts, responsive design |
An important behavior in the CSS Box Model is margin collapsing:
overflow: auto on the parent element.
The box model behaves differently based on the element's display property:
| Display Type | Box Model Behavior | Width/Height | Margin/Padding |
|---|---|---|---|
block |
Full box model applies | Respects width/height | All sides work |
inline |
Limited box model | Ignored | Only horizontal margins/padding work |
inline-block |
Full box model applies | Respects width/height | All sides work |
flex, grid |
Full box model applies | Respects width/height | All sides work |
Modern browsers provide developer tools to visualize the box model:
* { box-sizing: border-box; } to make layout calculations more intuitive and consistent across elements.
The CSS Box Model is a foundational concept that every web developer must understand. It dictates how elements are sized, spaced, and positioned on a page. By mastering the box model—including content, padding, border, and margin—developers can create precise, responsive, and visually appealing layouts. The introduction of the box-sizing property has made layout calculations more intuitive, particularly with the widespread adoption of border-box for modern web design.
This comprehensive question bank contains detailed 7-mark answers for MCA Web Technology examination. Each answer includes:
The answers are designed to meet examination requirements while providing practical knowledge for real-world web development.