Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
18 views94 pages

Web Exam Notes

The document explains key concepts in web technology, including protocols and programs. It defines protocols as standardized rules for data transmission, with examples like HTTP and FTP, and describes programs as software applications for developing websites, categorized into client-side and server-side. Additionally, it covers servers, DNS, IP addresses, and the importance of Internet Protocol in enabling communication and data routing across networks.

Uploaded by

ishanksharma024
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views94 pages

Web Exam Notes

The document explains key concepts in web technology, including protocols and programs. It defines protocols as standardized rules for data transmission, with examples like HTTP and FTP, and describes programs as software applications for developing websites, categorized into client-side and server-side. Additionally, it covers servers, DNS, IP addresses, and the importance of Internet Protocol in enabling communication and data routing across networks.

Uploaded by

ishanksharma024
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 94

1.

Define protocols and programs in web


technology with example.
Ans. 1. Protocols in Web Technology
Protocols in web technology are standardized sets
of rules and procedures that define how data is
transmitted, received, and processed between
different devices on a network, especially over the
internet. These protocols enable communication
between computers, servers, and other devices,
ensuring that the exchange of information is
reliable, secure, and understood by both ends.
Protocols help define:
• How a request is sent and received.
• How data is formatted.
• How errors are detected and corrected.
• How security is maintained during
communication.
In web technology, communication protocols are
essential because they form the backbone of the
internet by controlling how websites are
accessed, how files are shared, and how emails
are sent.
Examples of Web Protocols:
• HTTP (HyperText Transfer Protocol): Used for
transferring web pages and other content on
the World Wide Web.
• HTTPS (HTTP Secure): Same as HTTP but with
encryption for secure communication.
• FTP (File Transfer Protocol): Used to upload or
download files between client and server.
• TCP/IP (Transmission Control Protocol /
Internet Protocol): The foundational protocol
of the internet, responsible for breaking data
into packets and ensuring their delivery.
• SMTP (Simple Mail Transfer Protocol): Used
for sending emails.
• IMAP/POP3: Used for receiving emails.
Example Scenario:
When you type a website URL like
https://www.google.com, your browser uses the
HTTPS protocol to send a request to Google’s
server. The server responds with the web page
data, and your browser displays it. This
communication is possible only because both the
client and server understand and follow the same
protocol.

2. Programs in Web Technology


Detailed Definition:
Programs in web technology refer to the software
applications, scripts, and code that are used to
develop, control, and run websites or web-based
applications. These programs can be written in
different programming languages and are divided
into two main categories: Client-side and Server-
side.
• Client-side programs run in the user’s
browser. They handle the structure, design,
layout, and interactivity of a webpage.
• Server-side programs run on a web server.
They process user requests, interact with
databases, perform calculations, and send
results back to the client.
These programs work together to deliver
dynamic, interactive, and functional websites.
Examples of Programming Languages Used in
Web Technology:
Client-Side Programming:
• HTML (HyperText Markup Language): Defines
the structure of a web page.
• CSS (Cascading Style Sheets): Adds styles like
colors, fonts, layout to the page.
• JavaScript: Adds interactivity like sliders,
buttons, form validation.
Server-Side Programming:
• PHP: A scripting language commonly used for
web development (e.g., WordPress).
• Python: Used for back-end web development,
especially with Django or Flask.
• Java: Used for enterprise-level applications.
• Node.js: JavaScript-based server-side runtime.
Example Scenario:
When a user submits a login form:
• The HTML form provides the structure.
• JavaScript checks if the fields are filled
correctly.
• The data is sent to the server where a Python
or PHP program checks the database.
• If credentials are correct, the server sends a
success response; else, it shows an error.
These programs work together seamlessly to
deliver a complete user experience on the web.
2. What is server ? Describe Domain name server
in detail ?
Ans. 1. What is a Server?
A server is a computer system or software
application that provides services, resources, or
data to other computers, called clients, over a
network, usually the internet or a local network.
It is designed to respond to requests from client
devices. A server performs various functions such
as hosting websites, managing files, running
applications, storing databases, and more. It runs
continuously and is optimized for high
performance, reliability, and secure connections.
Key Features:
• Works on the Client-Server architecture.
• Responds to multiple client requests
simultaneously.
• Runs specific server software like Apache,
Nginx, or Microsoft IIS.
• Can be hardware-based or cloud-based (e.g.,
Amazon AWS server).
Types of Servers:
• Web Server – Delivers web pages (e.g.,
Apache, Nginx).
• File Server – Stores and manages files.
• Database Server – Handles database queries
(e.g., MySQL, Oracle).
• Mail Server – Sends and receives emails.
• Application Server – Hosts software
applications.
Example:
When a user opens www.google.com, the browser
sends a request to Google’s web server, which
processes the request and sends back the
homepage.
2. What is Domain Name Server (DNS)?

The Domain Name System (DNS) is a hierarchical


and distributed system used to translate human-
readable domain names (like www.example.com)
into machine-readable IP addresses (like
192.0.2.1). Since computers communicate over
networks using IP addresses, DNS acts as a
translator or directory service for the internet.
DNS allows users to access websites using easy-to-
remember names instead of numbers.
Why DNS is Needed:
Humans remember names (www.youtube.com),
but computers and servers use IP addresses to
locate each other. DNS bridges this gap by
converting domain names into IP addresses.

How DNS Works (Step-by-Step Process):


1. User enters a domain name into a browser
(e.g., www.facebook.com).
2. The request is sent to a recursive DNS resolver
(provided by your ISP).
3. If not cached, the resolver queries a Root DNS
Server.
4. The root server points to a TLD Server (e.g.,
.com).
5. The TLD server points to the Authoritative DNS
Server for the domain.
6. The authoritative server returns the IP address
(e.g., 157.240.20.35) to the resolver.
7. The resolver returns the IP to the browser,
which then connects to the website.
Types of DNS Servers:
Type Description
Receives the query from the
Recursive Resolver
user and finds the answer.
First step in name resolution,
Root Server
returns TLD info.
Handles extensions like .com,
TLD Server
.in, .org, etc.
Authoritative Stores the actual IP address of
Name Server the domain.

Example:
When you type www.instagram.com:
• DNS translates it into 157.240.18.174
• Your browser uses this IP to connect to the
Instagram server.
3. What is an IP Address? Explain different types of
IP Addresses in detail.
Ans. An IP Address (Internet Protocol Address) is
a unique numeric identifier assigned to every
device connected to a computer network that
uses the Internet Protocol for communication. It
acts like a digital address that allows devices (like
computers, mobile phones, or servers) to send
and receive data over a network.
Purpose of an IP Address:
1. Identification – Uniquely identifies a device
on the network.
2. Location Addressing – Helps in locating the
device so that communication can be properly
routed.
Just like your home address is used to receive
letters, an IP address is used to receive or send
data on a digital network, especially on the
internet.
Structure of IP Address:
There are two versions of IP addresses:
1. IPv4 (Internet Protocol Version 4)
o 32-bit number divided into four octets.
o Written in dotted decimal format:
192.168.0.1
o Provides around 4.3 billion unique
addresses.
2. IPv6 (Internet Protocol Version 6)
o 128-bit number, written in hexadecimal
separated by colons.
o Format:
2001:0db8:85a3:0000:0000:8a2e:0370:73
34
o Can support 340 undecillion addresses,
solving the address exhaustion issue of
IPv4.
Types of IP Addresses (Based on Use,
Assignment, and Scope):
IP addresses can be classified into six major types,
each with a specific role in network
communication.

1. Private IP Address
• Used within private networks (LAN) such as
homes, offices, or schools.
• Not visible or reachable from the internet.
• Assigned by local devices like routers.
• Helps devices within the same local network
communicate with each other.
Private IP Ranges:
• 10.0.0.0 – 10.255.255.255
• 172.16.0.0 – 172.31.255.255
• 192.168.0.0 – 192.168.255.255
Example:
Your mobile phone may have a private IP like
192.168.1.5 when connected to Wi-Fi.

2. Public IP Address
• Assigned by the Internet Service Provider
(ISP).
• Used to identify your device on the public
internet.
• Every website, server, and public-facing device
uses a public IP.
• It must be unique globally.
Example:
A website like www.example.com might have a
public IP like 203.0.113.45.

3. Static IP Address
• A fixed IP address that does not change over
time.
• Manually configured on a device or server.
• Ideal for web hosting, VPNs, remote access,
etc.
• Ensures consistent access for users or
systems.
Example:
A company website hosted on 198.51.100.24 will
always use this same IP.

4. Dynamic IP Address
• Assigned automatically by DHCP (Dynamic
Host Configuration Protocol).
• Changes every time the device reconnects to
the network.
• Used commonly by home users and general
internet users.
• Cost-effective and provides better security
(temporary IPs).
Example:
Your internet IP might be 123.45.67.89 today and
change to 123.45.68.90 tomorrow.

5. IPv4 Address (Version 4)


• 32-bit address written in four octets (e.g.,
192.0.2.1).
• Still widely used in homes, businesses, and
servers.
• Supports around 4.3 billion addresses.
• Suffering from exhaustion due to growing
number of internet-connected devices.

6. IPv6 Address (Version 6)


• 128-bit address written in hexadecimal format
(e.g., 2001:db8:0:1234::abcd).
• Designed to replace IPv4.
• Supports 340 undecillion unique addresses.
• Enables the Internet of Things (IoT) by
allowing each smart device to have a unique
IP.
----------------------------------------------------------------
3. Explain Hypertext transfer protocol and User
data gram protocol ?
Ans. HTTP (Hypertext Transfer Protocol) is an
application layer protocol used for transferring
data on the World Wide Web (WWW). It
defines how messages are formatted,
transmitted, and how web servers and
browsers should respond to various commands.
It follows a client-server model, where the
client (usually a web browser) sends an HTTP
request and the server responds with the
requested content (like HTML, images, videos,
etc.).
Key Characteristics:
1. Stateless: Each request is treated
independently. The server does not retain
user information between different requests.
2. Uses TCP/IP: HTTP works over TCP
(Transmission Control Protocol), ensuring
reliable data transmission.
3. Default Port: HTTP works on port 80, and
HTTPS (secure version) works on port 443.
4. Text-based Protocol: Human-readable
commands like GET, POST, PUT, DELETE, etc.
5. Secure Version: HTTPS adds encryption using
SSL/TLS for secure communication.

How HTTP Works (Step-by-Step):


1. You open a browser and type a website URL
(e.g., https://www.wikipedia.org)
2. The browser creates an HTTP GET request and
sends it to the server.
3. The server processes the request and sends
back the web page (HTML/CSS/JS).
4. The browser renders the content for you.

Common HTTP Methods:


Method Description
GET Retrieve data (e.g., get a webpage)
POST Submit data (e.g., login form)
PUT Update existing data
DELETE Remove data

Example:
GET /index.html HTTP/1.1
Host: www.example.com
This means: "Get the file index.html from the
host example.com."
2. User Datagram Protocol (UDP)
Definition:
UDP (User Datagram Protocol) is a transport
layer protocol that allows data to be sent
without establishing a connection between the
sender and receiver.
It is known as a connectionless, lightweight,
and faster protocol compared to TCP. It is used
when speed is more important than reliability.

Key Characteristics:
1. Connectionless: No need to set up or break
down a connection before/after
communication.
2. No Error Checking: It doesn’t ensure the
message reached correctly or at all.
3. Unreliable but Fast: No retransmissions,
making it suitable for real-time applications.
4. Packet-based: Sends data as individual
datagrams (packets).
5. Low Overhead: Very little extra data is sent
with each message.

How UDP Works:


1. Data is divided into small chunks (called
datagrams).
2. These datagrams are sent over the network to
the receiver’s IP address and port.
3. The receiver processes whatever arrives. Lost or
out-of-order packets are ignored or handled by
the application.

When to Use UDP:


• Live Video/Audio Streaming (e.g., YouTube
Live, Facebook Live)
• Online Gaming (e.g., PUBG, Call of Duty)
• VoIP Applications (e.g., Zoom, Skype,
WhatsApp Call)
• DNS Lookups (DNS uses UDP on port 53)
Example:
When you make a WhatsApp voice call:
• Your voice is converted into small UDP packets
and sent instantly.
• If a few packets are lost, the call continues —
because real-time delivery matters more than
perfect quality.

Summary:
• HTTP is used for loading websites and web
content, ensuring data arrives correctly using
TCP.
• UDP is used for fast communication where
speed is more important than accuracy (like
video calls or games).

4. Why internet protocol is important?


Ans. Importance of Internet Protocol (IP):
1. Provides Unique Identification
• Every device connected to a network is
assigned a unique IP address.
• This IP address is like a digital home address,
which helps devices identify and communicate
with each other.
• Without IP, there would be no way to know
where to send or receive data.
2. Enables Data Routing
• IP ensures that data packets are routed
correctly from the source to the destination.
• It breaks down data into packets, labels them
with sender and receiver IP addresses, and
ensures they reach the correct path.
• Routers and gateways use IP information to
decide which path the data should take.
3. Supports Internetworking
• IP allows different types of networks (LAN,
WAN, etc.) to communicate with each other.
• It makes the internet possible by connecting
billions of devices globally.
• This internetworking ability is crucial for
global communication, file transfer, web
browsing, video calling, etc.
4. Scalability
• IP is designed to handle both small and large
networks.
• With the introduction of IPv6, it can now
support trillions of devices, which is
necessary due to the growing number of
internet-connected devices (IoT).
5. Standardized Communication
• IP follows international standards (defined by
IETF), making it universally accepted.
• Devices made by different manufacturers
(phones, routers, computers) can
communicate seamlessly using IP.
6. Facilitates Internet Services
• All major internet services like email, web
browsing, video streaming, online gaming,
cloud computing, etc., work because of IP.
• Without IP, you wouldn’t be able to access
websites, send emails, or use apps that rely on
the internet.
7. Error Handling and Data Fragmentation
• IP is responsible for breaking large data into
smaller packets and reassembling them at
the destination.
• It also detects errors such as unreachable
destinations and informs the sender.
----------------------------------------------------------------
5. What is different between UDP and TCP
protocols?
Ans. What is UDP (User Datagram
Protocol)?
UDP is a connectionless transport layer protocol
that sends data without checking whether it was
received. It is fast but unreliable. It doesn’t
guarantee delivery, ordering, or error checking.
It is used where speed is more important than
accuracy, like live streaming, online gaming, or
video calls.

What is TCP (Transmission Control


Protocol)?
TCP is a connection-oriented transport layer
protocol that ensures reliable and ordered
delivery of data. It checks for errors, resends lost
packets, and ensures the data arrives correctly.
It is used for web browsing, email, file transfer,
etc., where reliability is important.
Difference between UDP and TCP (Table
Format):
UDP (User Datagram TCP (Transmission
Protocol) Control Protocol)
It is connection-
It is connectionless.
oriented.
UDP (User Datagram TCP (Transmission
Protocol) Control Protocol)
Faster, with low Slower, due to error-
latency. checking.
No guarantee of Guarantees delivery
delivery. and order.
No error checking or Has error checking
correction. and correction.
Suitable for live
Suitable for web
streaming, online
browsing, file transfer.
games.
Heavier with more
Lightweight protocol
overhead due to
with less overhead.
handshakes.
Data may arrive out of Ensures data arrives in
order. correct order.
6. Explain HTTP and secure HTTP in detail ?
Ans. HTTP stands for Hypertext Transfer Protocol.
It is a protocol used by web browsers and servers
to communicate and transfer web pages over the
Internet.
Explanation:
• HTTP works in a client-server model.
• When you enter a URL in your browser, it
sends an HTTP request to the server.
• The server responds with an HTTP response,
which contains the requested webpage,
images, videos, etc.
• It works on port 80 by default.
• HTTP is a stateless protocol, meaning it does
not remember past communications (each
request is independent).
• It uses text-based communication, which
makes it easy to read and debug.
Example:
Typing http://www.example.com in the browser
uses HTTP to request the page.

2. What is HTTPS (Secure Hypertext Transfer


Protocol)?
Definition:
HTTPS stands for Hypertext Transfer Protocol
Secure. It is the secure version of HTTP that uses
encryption to protect data transferred between
the client and server.
Explanation:
• HTTPS uses SSL (Secure Sockets Layer) or TLS
(Transport Layer Security) to encrypt data.
• It ensures that sensitive information like
passwords, banking details, or personal data
remains private and secure.
• It works on port 443 by default.
• HTTPS provides three main security features:
o Data encryption (protects data during
transmission)
o Authentication (verifies that you're
communicating with the correct server)
o Data integrity (ensures data is not
changed or tampered with)
Example:
Typing https://www.bank.com ensures that
communication is secure and encrypted.

Key Differences between HTTP and HTTPS


HTTP HTTPS
Data is not Data is encrypted using
encrypted SSL/TLS
Works on port 80 Works on port 443
Not secure for Secure for passwords,
sensitive data payments, etc.
HTTP HTTPS
No authentication of Server identity is verified
server with SSL certificate
Used for normal Used for secure websites
websites like banks, e-commerce

8. Explain Three tier architecture of web


application development?
Ans.
1. Presentation Tier (Client Tier)
2. Application Tier (Logic Tier)
3. Data Tier (Database Tier)
Each tier is responsible for a specific task and
communicates with the others in a structured
and organized way.
1. Presentation Tier (Client Layer):
• Also called the User Interface (UI) Layer.
• This is the front-end of the application that
the user interacts with.
• It handles displaying data, receiving user
input, and sending it to the application layer.
• Built using HTML, CSS, JavaScript, etc.
Example:
A login form on a website (where users enter
username and password).

2. Application Tier (Business Logic Layer):


• Also called the Middle Layer or Logic Layer.
• This layer processes the business logic and
rules of the application.
• It takes input from the presentation tier,
processes it, and interacts with the database.
• Built using programming languages like Java,
Python, PHP, .NET, etc.
Example:
It checks if the login details entered by the user
match what's in the database.

3. Data Tier (Database Layer):


• Also called the Storage Layer.
• It stores and retrieves data from the database.
• This layer communicates only with the
Application Layer.
• Uses Database Management Systems (DBMS)
like MySQL, Oracle, MongoDB, etc.
Example:
Stores user information like name, password,
email in the database and sends data when
requested.

Diagram Representation:
[ Presentation Layer ]
(HTML/CSS/JS)

[ Application Layer ]
(Java/PHP/Python)

[ Data Layer ]
(MySQL/Oracle DB)

Advantages of Three-Tier Architecture:


Advantage Description
Each tier is independent, making
Modularity maintenance easier.

You can scale each layer


Scalability separately.
Direct access to the database is
Security restricted to only the application
layer.
Business logic and data access
Reusability can be reused in other apps.
9. Define types of List in HTML ?
Ans. Definition:
In HTML (HyperText Markup Language), a list is
a way to group related items together in a
structured format. Lists are commonly used to
display menus, steps, features, or grouped
information.
There are three main types of lists in HTML:

Ordered List (<ol>)


• Represents a list of items in a specific
sequence or order.
• Each item is numbered automatically by the
browser (1, 2, 3…).
• Used when the order of items matters (e.g.,
steps in a recipe, instructions).
----------------------------------------------------------------
Unordered List (<ul>)
• Represents a list of items in no specific order.
• Each item is marked with bullets by default
(●).
• Used for lists where sequence is not
important, such as features or ingredients.
Description List (<dl>)
• Represents a list of terms and their
descriptions.
• Commonly used in dictionaries, glossaries, or
FAQ sections.
• Uses:
o <dl> for the whole list
o <dt> for the term (definition title)
o <dd> for the description
10. What is CSS ? Explain Inline style sheet,
External Style sheet and Internal Style sheet ?
Ans. CSS (Cascading Style Sheets) is a style
sheet language used to describe how the
elements in a web page (written in HTML or
XML) should look and appear on the screen.
The main goal of CSS is to make websites look
beautiful, organized, and responsive
(adjustable on all screen sizes like mobile,
tablet, or desktop).
It separates the structure (HTML) from the
presentation (CSS), which helps in writing
cleaner and more manageable code.

Why is it called “Cascading”?


The word "Cascading" means that CSS rules are
applied in a priority order. If there are multiple
styles for the same element, the browser
decides which one to apply based on the
following rules:
TYPES OF CSS –

1. Inline CSS (Inline Style Sheet)


Definition:
Inline CSS means writing the style directly
inside an HTML tag using the style attribute.
It is used to apply a unique style to one
single element only.
Example:
Advantages:
• Very simple and easy to use.
• Useful for testing or small quick changes.
• The browser loads it fast because it's
already in the HTML.

Disadvantages:
• Not good for big websites.
• Hard to maintain if you have many
elements.
• Mixing HTML and CSS together makes
code messy.
• You cannot reuse this style for other
elements easily.
2. Internal CSS (Internal Style Sheet)
Definition:
Internal CSS means writing the CSS inside
the <style> tag in the <head> section of
the HTML file.
It is used to style the entire page (multiple
elements) in one place.

Explanation in Simple Words:


Think of internal CSS like writing a mini
styling guide at the top of your HTML file.
Then, the whole page can use those styles.

Example:
Advantages:
• Better than inline CSS for styling full page.
• You can control multiple elements from
one place.
• Keeps styling separate from content
(cleaner code).
Disadvantages:
• Only works for one page (can’t be reused
on other pages).
• Not suitable for big websites with many
pages.

3. External CSS (External Style Sheet)


Definition:
External CSS means writing all CSS styles in
a separate file (with a .css extension) and
linking that file to your HTML using the
<link> tag.

Explanation in Simple Words:


Think of external CSS like a common dress
code for all pages.
You keep all styles in one file and use that
file on as many HTML pages as you want.
Example:

Advantages:
• Best option for big websites.
• Styles can be reused on multiple pages.
• Keeps HTML file clean and improves
website loading speed.
• Easy to update styles from one place.
Disadvantages:
• Needs an extra file, so if it's not loaded,
styles may not appear.
• Slightly complex for beginners compared
to inline or internal CSS.

11. Describe various types of formatting tags in


HTML ?
Ans. Formatting tags in HTML are used to
change the appearance or style of the text.
These tags help make the text bold, italic,
underlined, and much more — for better
readability and emphasis on important content.
Simply put: Formatting tags make plain text
look more attractive or meaningful.
12. Define frames fo designing a good interactive
website ?
Ans. What Are Frames in Web Design?
In web design, frames refer to structural
divisions within a web page that organize
content visually and functionally. These frames
are part of the layout design that helps in
creating user-friendly, interactive, and well-
structured websites.
In simple words: Frames are the building
blocks or sections of a website that make it
easier to design and navigate.
Characteristics of Good Frames
• Visually clear and organized
• Easy to navigate
• Responsive (mobile-friendly)
• Interactive (with animations, hover
effects, etc.)
• Accessible to all users, including those
with disabilities
13. Explain AJAX on web application ?
Ans. AJAX stands for Asynchronous JavaScript
and XML.
It is a web development technique used to
create fast, dynamic, and interactive web
applications by allowing web pages to update
parts of content without reloading the entire
page.
In simple words:
AJAX lets your webpage talk to the server in the
background and update only the necessary part
of the page — without refreshing the whole
page.

How AJAX Works (Step-by-Step):


1. User triggers an event
(e.g., clicks a button or types in a search box)
2. JavaScript creates an XMLHttpRequest object
This object handles communication with the
server.
3. Request is sent to the server
(without reloading the webpage)
4. Server processes the request
and sends back a response (usually in JSON or
XML)
5. JavaScript receives the response
and updates the webpage content
dynamically.

Example of AJAX:
Imagine a search box on a shopping site:
• As soon as you start typing "headphones", it
shows matching suggestions.
• That’s AJAX sending your typed text to the
server and showing results — without
reloading the page.
Advantages of AJAX:
• Faster user experience (no full page
reload)
• Improves responsiveness and interactivity
• Partial page updates = less data = better
performance
• Seamless background communication
with server

Limitations of AJAX:
• Doesn’t work if JavaScript is disabled in
the browser
• May cause issues with browser
back/forward buttons
• Requires extra care for security (e.g., data
leaks, XSS)
• SEO challenges (since content loads
dynamically)

14. What is Java Applet ? Write a code for it ?


Ans. A Java Applet is a small Java program that
runs inside a web browser. It is used to create
interactive features in web applications such as
games, animations, charts, or dynamic user
interfaces.
Key Features of Java Applets:
• Runs inside a browser using Java Plugin.
• Embedded in HTML using <applet> tag or
<object> tag.
• Cannot access local system resources (for
security).
• Needs the Java Virtual Machine (JVM) in the
browser.
15. Explain Function in JAVA script object event
handler with example ?
Ans. In JavaScript, a function inside an object
can be used as an event handler to respond to
user actions like clicking a button, hovering over
a div, or typing in a text box.
An event handler is a function that "handles" or
responds to a specific event (like onclick,
onmouseover, etc.).

Concept Explained:
• You can create a JavaScript object that
contains methods (functions).
• One of these methods can be assigned as an
event handler to an HTML element.
• When the event (like a mouse click) happens,
the function is executed.
UNIT-3
16. Describe Document object Model? in detail?
Ans. The Document Object Model (DOM) is a
programming interface provided by the browser
that allows developers to access, modify, and
interact with the structure and content of a
webpage.
It represents the HTML or XML content of a web
page as a tree structure (also called a node tree),
where each element, attribute, and piece of text
is a node in the tree.

In Simple Words:
The DOM turns everything in your HTML page —
like paragraphs, buttons, images, etc. — into
objects that JavaScript can read, change, or
delete.
17. What is Java script object ? Explain different
type of object used in JS?
Ans. A JavaScript Object is a collection of key-
value pairs (also called properties), where the
keys are strings (called property names) and the
values can be any data type — strings, numbers,
arrays, functions, or even other objects.
It is used to store and manage data in a
structured way.
18. Write difference HTML and DHTML?

19. Type of operaors in JS ?


Ans. Arithmetic Operators
Used to perform basic math operations.
➤ +, -, *, /, %, ++, --
Example: let sum = a + b;
1. Assignment Operators
Used to assign values to variables.
➤ =, +=, -=, *=, /=, %=
Example: x += 5; // x = x + 5
2. Comparison Operators
Used to compare two values.
➤ ==, ===, !=, !==, >, <, >=, <=
Example: a == b
3. Logical Operators
Used to combine multiple conditions.
➤ && (AND), || (OR), ! (NOT)
Example: if (a > 5 && b < 10)
4. Bitwise Operators
Used to perform bit-level operations.
➤ &, |, ^, ~, <<, >>, >>>
Example: a & b
5. String Operators
Used to concatenate (join) strings.
➤ +, +=
Example: "Hello " + "World"
6. Type Operators
Used to check data type or object.
➤ typeof, instanceof
Example: typeof "hello" returns "string"
7. Conditional (Ternary) Operator
Short form of if-else.
20. What are the 4 components of DHTML ?
Ans. 4 Components of DHTML (Dynamic
HTML) – Explained in Short:
DHTML is not a language, but a combination of
technologies used to create interactive and
dynamic web pages.

1. HTML (HyperText Markup Language)


• Purpose: Provides the basic structure of the
web page.
• Example: Defines headings, paragraphs,
images, tables, forms, etc.

2. CSS (Cascading Style Sheets)


• Purpose: Used to style the HTML elements
(colors, fonts, layouts).
• Example: p { color: red; font-size: 16px; }

3. JavaScript
• Purpose: Makes the page interactive and
dynamic by handling user actions.
• Example: Show alert box, validate forms,
change content dynamically.

4. DOM (Document Object Model)


• Purpose: Represents the web page as a tree
structure, allowing JavaScript to access and
manipulate HTML and CSS.
• Example:
document.getElementById("title").innerHTML
= "Welcome"
Component Role in DHTML
HTML Structure
CSS Styling
JavaScript Interactivity
DOM Access & Manipulation
21. What is POP UP box ? What are the types of
pop up box available in JS ?
Ans. A pop-up box in JavaScript is a small dialog
window that appears on the browser to interact
with the user. It is commonly used to:
• Show messages
• Take user input
• Confirm actions
Pop-up boxes are built-in functions in JavaScript,
and they are simple to use without any HTML or
CSS. Types of Pop-Up Boxes in JavaScript:
There are 3 main types of pop-up boxes in
JavaScript.
1. Alert Box (alert())
• Purpose: Displays a simple message to the
user.
• User Response: Only "OK" button.
• Use Case: To show warnings, information, or
notifications.
Example:

2. Confirm Box (confirm())


• Purpose: Asks the user to confirm or cancel
an action.
• User Response: "OK" or "Cancel" button.
• Use Case: To confirm deletion or submission.
3. Prompt Box (prompt())
• Purpose: Used to take input from the user.
• User Response: Input field + "OK" / "Cancel"
buttons.
• Use Case: To ask for name, age, or any value
from the user.

22. What is the try catch statement in js ? Write


its uses in brief ?
Ans. What is try...catch in JavaScript?
The try...catch statement is used in JavaScript to
handle errors (exceptions) in a clean and
controlled way, without crashing the whole
program.
UNIT-4
-------------------------------------------------------------------
23. Define XML and write the use of XML ?
Ans. XML stands for eXtensible Markup Language.
It is a markup language like HTML, but it is
designed to store, transport, and structure data,
not display it. XML is a text-based language used
to define custom tags that store and transport
data in a structured and readable format. It is
both human-readable and machine-readable.

Key Features of XML:


• It is platform-independent and language-
neutral.
• It allows users to define their own tags.
• It is self-descriptive (data is stored with
metadata).
• It stores data in a tree-like structure.
Syntax Example of XML:
<student>
<name>Ishank</name>
<rollno>101</rollno>
<branch>Computer Science</branch>
</student>
This XML represents a student's data in a
structured way.

Uses of XML:
Use Explanation
XML is used to store structured
Data storage
data in files or databases.
Used to exchange data
Data
between different systems,
exchange
especially web services.
Use Explanation
Many applications use XML to
Configuration
store settings and
files
configurations.

Web services XML is the foundation of SOAP,


(SOAP, RSS, etc.) WSDL, and RSS feeds.
Android apps use XML for
Android
designing layouts
development
(activity_main.xml).
Used in office files (e.g., .docx,
Document
.xlsx) which are actually XML-
structure
based.

Why XML is Important:


• Standard way to represent data.
• Ensures data integrity across platforms.
• Easy to validate using DTD or XML
Schema.
24. What is JSON ? Describe JSON data types and
objects in detail.
Ans. What is JSON? (JavaScript Object
Notation)
JSON is a lightweight, text-based format used for
storing and transferring data, especially between
a server and a client in web applications.
It is language-independent but is mainly based on
JavaScript syntax. It is now used with many
programming languages like Python, Java, PHP, C#,
etc.

Why JSON?
• JSON is easy to read, write, and understand.
• It is faster and less bulky than XML.
• Most modern APIs and web services use JSON
to exchange data.
• It can be used to store structured information
such as user profiles, product data, messages,
etc.
Example JSON Data
{
"name": "Ishank",
"age": 23,
"isStudent": true,
"subjects": ["HTML", "CSS", "JavaScript"],
"address": {
"city": "Raipur",
"state": "Chhattisgarh"
}
}
JSON Data Types (In Detail)

JSON Object (In Detail)


A JSON object is a collection of key/value pairs
written inside {}.
Each key is a string, and the value can be any data
type (string, number, boolean, array, object, or
null).
Example:
{
"product": {
"id": 101,
"name": "Laptop",
"price": 49999,
"available": true
}
}
JSON vs JavaScript Object
JSON JavaScript Object
Pure data format, no Can contain both
functions data and functions
Keys and strings must use Can use single or
double quotes double quotes
Only supports data types Can have methods,
like string, number, etc. undefined, etc.
Used for data transmission Used in actual
(like APIs) JavaScript code logic

Uses of JSON
Area Description
Most APIs return response in
Web APIs
JSON format
Apps use JSON to store and
Mobile Apps
exchange data with servers
Configuration Applications use JSON files to
Files store settings (e.g., .json files)
JSON can be used in NoSQL
Data Storage
databases like MongoDB
Data JSON is used to send data
Interchange between frontend and backend

How JSON is Used in Real Life


1. E-commerce Website:
Product details like name, price, ratings,
reviews are stored and transferred using
JSON.
2. Mobile Apps (like WhatsApp or
Instagram):
User data, messages, and notifications are
sent to and received from the server in JSON
format.
3. Web APIs (like Weather API):
Data such as temperature, location, forecast is
returned from the API in JSON format.

25. What is XSL ? Describe main parts of XSL


documents and how its works ?
Ans. What is XSL?
XSL stands for eXtensible Stylesheet Language. It
is a language used for expressing stylesheets for
XML documents. Just like CSS is used to style
HTML, XSL is used to style and transform XML
data for display and presentation.
It helps transform XML data into a readable and
user-friendly format like HTML, PDF, or plain text.
Main Parts of XSL Documents:

How XSL Works:


1. An XML file contains raw data.
2. An XSL stylesheet defines how to transform or
present this data.
3. A processor (like a browser or tool like Xalan
or Saxon) reads both files.
4. The processor applies the XSL rules to the
XML data and produces an output (HTML,
PDF, text, etc.).
Example:
XML File:
<student>
<name>Ishank</name>
<grade>A+</grade>
</student>
-------------------------------------------------------------------
Uses of XSL:
• Convert XML into web pages (HTML).
• Generate PDFs or printed reports from XML.
• Reformat XML for data exchange between
systems.
• Help display dynamic data in applications.
26. Write short note on AJAX request and
response and XML key components ?
Ans. AJAX stands for Asynchronous JavaScript
and XML. It is used to send and receive data from
a server without reloading the webpage.
AJAX Request:
• The browser (client) sends a request to the
server in the background using
XMLHttpRequest or fetch().
• It can send data using GET or POST methods.
• The request does not interrupt the current
page.
AJAX Response:
• The server processes the request and sends
back a response (in XML, JSON, HTML, or
plain text).
• JavaScript receives the response and updates
the webpage dynamically without refreshing.
27. Difference Between XML and JSON ?
Ans.
UNIT – 5
28. Define Sever Side scripiting languages ?
Ans. Server-side scripting languages are
programming languages used to create the
backend of a website or web application. These
scripts run on the web server, not on the user's
browser (client-side). When a user requests a
webpage, the server executes the script,
generates the necessary HTML, and sends it to the
browser.

Key Features:
• Executes on web server
• Dynamically generates web content
• Can interact with databases
• Handles form submissions, user
authentication, etc.
• Provides better security compared to client-
side scripting
Popular Server-Side Scripting Languages:
Language Description
Most widely used, open-source, easy to
PHP
integrate with HTML and MySQL
Powerful and readable, used with
Python
frameworks like Django and Flask
JavaScript running on the server side,
Node.js
fast and event-driven
Used with Ruby on Rails, known for its
Ruby
simplicity
Used for enterprise-level applications
Java
(with JSP, Servlets)
Developed by Microsoft, supports
ASP.NET
multiple languages like C#

Why Server-Side Scripting is Important:


• Allows creation of dynamic websites
• Enables database interaction
• Secures user data handling
• Supports sessions and cookies

29. Explain Basic command in PHP for


implementation of data base server ?
Ans. PHP works with MySQL databases to store,
retrieve, update, or delete data. Here are the basic
steps and commands:
30. What is the use of advanced PHP ? Describe
function of PHP?
Ans. Advanced PHP goes beyond the basics (like
form handling and connecting to databases) and
focuses on building dynamic, secure, powerful
web applications using modern techniques and
features.
31. Write short notes
on Describe Array in PHP and Data Base Bugs?
Ans. An array in PHP is a data structure that stores
multiple values in a single variable. It's useful
when you want to group related values together
(like a list of names, numbers, etc.).
Types of Arrays in PHP:
Indexed Array
• Uses numeric keys (starting from 0)
Associative Array
• Uses named keys
Multidimensional Array
• Array inside another array
Prevention Tips:
• Use prepared statements.
• Validate and sanitize input.
• Handle exceptions and show user-friendly
errors.
32. How to solve
Bugs in PHP ?
Ans.
33. List the feature of
PHP my SQL ?
Ans.
34. Explain PHP
myADMIN wit its features ?
Ans. phpMyAdmin is a free, open-source, web-
based tool written in PHP that allows users to
manage MySQL or MariaDB databases through a
graphical user interface (GUI).
Instead of writing SQL commands manually, you
can create, manage, and modify databases,
tables, records, and users easily through your
web browser using phpMyAdmin.

Why Use phpMyAdmin?


• It's user-friendly, even for beginners.
• You don’t need to know complex SQL
commands.
• It helps manage large databases with ease.
Key Features of phpMyAdmin:

Feature Description
No.
Accessible from any
Web-based
1 browser, no need to use
Interface
terminal or command line.
Create, rename, drop
Database
2 (delete), or copy databases
Management
easily.
Table Create, browse, edit, drop,
3
Operations and export/import tables.
You can write and execute
SQL Query
4 custom SQL queries directly
Execution
from the interface.
Export/import databases in
Data Export &
5 various formats like SQL,
Import
CSV, XML, PDF, etc.
Feature Description
No.
Add, delete, and assign
User
6 privileges to MySQL users
Management
easily.
Create backups (export) of
Backup and
7 your database and restore
Restore
(import) when needed.
Search for specific records
8 Search Feature in a table or entire
database.
Multiple
Supports many languages,
9 Language
useful for global users.
Support
Can connect and manage
Multi-server multiple MySQL servers
10
Management from one phpMyAdmin
interface.
🛠 Example Use:
• Create a new database named students.
• Create a table marks with fields like name,
subject, and marks.
• Insert, edit, or delete data without writing any
SQL.

Where is it Used?
• Web hosting platforms (like XAMPP, WAMP,
cPanel)
• Local development (localhost)
• Admin panels for small and medium websites

-----------------------------------xx-----------------------------

You might also like