1.
Client-side scripting vs Server-side scripting
Client-side scripting is executed on the user's browser and focuses on UI behavior, interactivity, and
dynamic content rendering (e.g., JavaScript, HTML, CSS). It allows immediate feedback and
reduces server load.
Server-side scripting runs on the server and handles database operations, authentication, and
business logic (e.g., PHP, Node.js). It generates complete HTML content and sends it to the client.
Client-side scripts are faster for UI tasks, while server-side scripts are secure and powerful for
processing data. Both are essential for modern web applications, working together to provide a full
user experience.
2. What are web services? What are functions and components of web services?
Web services are software systems designed to support interoperable machine-to-machine
interaction over a network using protocols like HTTP. They allow applications to communicate
regardless of language or platform.
Functions:
- Data sharing between systems
- Platform-independent communication
- Integration of applications
Components:
- SOAP (Simple Object Access Protocol) or REST (Representational State Transfer)
- WSDL (Web Services Description Language)
- UDDI (Universal Description, Discovery, and Integration)
Web services are commonly used in APIs for weather apps, payment gateways, and mobile apps.
3. What do you mean by AJAX? Explain working of AJAX
AJAX (Asynchronous JavaScript and XML) is a technique used in web development to send and
receive data from a server asynchronously without reloading the page. It enhances user experience
by allowing dynamic content updates.
Working:
1. A browser event (e.g., button click) triggers JavaScript.
2. JavaScript creates an XMLHttpRequest object.
3. Request is sent to the server.
4. Server processes the request and sends back data.
5. JavaScript receives and updates the webpage.
AJAX is widely used in search suggestions, live forms, and chat applications.
4. Explain XML document structure with the help of an example
XML (eXtensible Markup Language) is used to store and transport data in a structured, readable
format. It consists of elements enclosed in tags.
Structure:
<book>
<title>Web Development</title>
<author>Aman</author>
<year>2025</year>
</book>
In this example:
- <book> is the root element.
- <title>, <author>, and <year> are child elements.
Each element must have a matching closing tag. XML is case-sensitive, supports nested structures,
and allows custom tag names. It is commonly used in configuration files, data exchange, and APIs.
5. What is Rest parameter and Spread parameter in ES6?
In ES6, Rest parameter allows a function to accept an indefinite number of arguments as an array
using '...'.
Example:
function sum(...nums) { return nums.reduce((a, b) => a + b); }
This collects arguments into a single array.
Spread parameter is used to expand elements of an array or object.
Example:
const arr = [1, 2, 3];
console.log(...arr); // 1 2 3
Spread is used for copying arrays, combining arrays, or passing array elements as individual
arguments. Both make JavaScript code cleaner and more efficient.
6. Explain string methods in ECMA Script
ECMAScript (JavaScript standard) provides many built-in string methods to manipulate and process
text.
Examples:
- length: Returns string length
- toUpperCase(), toLowerCase(): Change case
- charAt(index): Returns character at position
- includes(substring): Checks for substring
- substring(start, end): Extracts part of string
- split(separator): Converts string to array
- replace(search, value): Replaces substring
- trim(): Removes whitespace
These methods help format and handle textual data efficiently in web applications.