0% found this document useful (0 votes)
7 views

WebTechnologies(university) PartA

class notes

Uploaded by

infantayazhini
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

WebTechnologies(university) PartA

class notes

Uploaded by

infantayazhini
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

1.

State the Significance of WWW (World Wide


Web)
The World Wide Web (WWW) is a vast,
interconnected system of hypertext documents
accessed via the internet using web browsers. Its
significance includes:
• Information Sharing: WWW enables users to
access and share vast amounts of information
in various formats (text, images, videos, etc.)
across the globe.
• Global Communication: It provides platforms
for emails, social media, forums, and
messaging, making communication
instantaneous.
• E-commerce: It facilitates online shopping,
banking, and services, revolutionizing business
transactions.
• Collaboration: Tools for real-time collaboration,
such as Google Docs, and content sharing are
made possible through the WWW.
• Access to Resources: It offers a wealth of
online resources in education, research,
entertainment, and more, available to anyone
with internet access.

2. How Will You Create a Password File in an


HTML Form?
To create a password input field in an HTML form,
you use the <input> element with the
type="password" attribute. This hides the entered
characters to protect the user's privacy. Here's an
example:
<!DOCTYPE html>
<html>
<head>
<title>Password Form</title>
</head>
<body>

<h2>Password Form</h2>
<form action="/submit_password"
method="post">
<label for="password">Password:</label>
<input type="password" id="password"
name="password" required><br><br>
<input type="submit" value="Submit">
</form>
</body>
</html>
This form will accept a password from the user and
submit it to a server-side script (e.g., PHP, Node.js)
for processing.

3. Define Event. How Are Events Handled in


JavaScript?
An event in JavaScript refers to an occurrence that
the browser recognizes and that can trigger a
function, such as a mouse click, keyboard input, or
page load.
• Event Handling: In JavaScript, events are
handled by assigning event listeners to DOM
elements.
1. Using HTML attributes:
Example:
<button onclick="alert('Button Clicked!')">Click
Me</button>
2. Using JavaScript (addEventListener):
Example:
document.getElementById("myButton").addEventLi
stener("click", function() {
alert('Button Clicked!');
});
• This method is more flexible and recommended
for adding multiple event handlers.

4. What is Meant by DHTML?


DHTML (Dynamic HTML) is a combination of HTML,
CSS, and JavaScript used to create interactive and
dynamic web pages. Unlike static web pages,
DHTML allows for changes in the content and
structure of a webpage without needing to reload the
entire page. It enables:
• Dynamic Content: Changing text, images, and
styles dynamically.
• User Interaction: User actions can modify the
webpage content (e.g., menus, pop-ups).
• Animation Effects: Elements can move, resize,
or change colors based on user input.

5. What Are the Differences Between Generic


Servlet and HTTP Servlet?
Feature Generic Servlet HTTP Servlet
Serves as a base
Specializes in handling
Purpose class for all
HTTP requests.
servlets.
Protocol-
independent
Protocol Works specifically with
(works with
Support HTTP protocol.
different
protocols).
service(): Extends service() to
Handles handle HTTP-specific
Methods
requests based methods like doGet()
on protocol type. and doPost().
Inherits init() and
Lifecycle init(), service(),
destroy() from
Methods destroy().
GenericServlet, but has
Feature Generic Servlet HTTP Servlet
additional HTTP-
specific methods.

6. Distinguish Between Get Request and Post


Request Type in Servlets
Aspect GET Request POST Request
Appends data to Sends data in the
Data
the URL (in the body of the
Transmission
query string). request.
Less secure, as More secure, as
Security data is exposed data is sent in the
in the URL. request body.
Limited by URL
No such
length (typically
Data Length limitations, can
2048
handle large data.
characters).
Used for Used for
retrieving data submitting data
Use Case
(e.g., search (e.g., form
queries). submissions).
7. Write a Program in PHP to Create and Retrieve
Data from the Text File
<?php
// Creating and writing data to a text file
$file = fopen("data.txt", "w"); // Open file for writing
if ($file) {
fwrite($file, "Hello, this is a text file.\n");
fwrite($file, "Data written from PHP.\n");
fclose($file); // Close the file
}

// Reading data from the text file


$file = fopen("data.txt", "r"); // Open file for reading
if ($file) {
while ($line = fgets($file)) {
echo $line; // Display each line
}
fclose($file); // Close the file
}
?>
This PHP script creates a text file, writes data to it,
and retrieves the data for display.

8. What is Meant by an XML Namespace?


An XML namespace is a way to uniquely identify
elements and attributes in XML documents,
preventing naming conflicts. It uses a Uniform
Resource Identifier (URI) to define a scope for
element names.
• Purpose: To distinguish elements with the same
name but different meanings in an XML
document.
• Syntax: The xmlns attribute is used to declare a
namespace.
<book xmlns="http://www.example.com/book">
<title>XML Basics</title>
</book>
9. What is the Difference Between Angular and
NodeJS?
Aspect Angular NodeJS
A back-end
A front-end framework
JavaScript
Type for building web
runtime
applications.
environment.
Used for
Used for developing
building
single-page applications
Purpose scalable,
(SPAs) with dynamic user
server-side
interfaces.
applications.
JavaScript (for
JavaScript/TypeScript
Language server-side
(primarily).
scripting).
Event-driven,
Two-way data binding,
Key non-blocking
component-based
Features I/O, scalable
architecture.
architecture.

10. What Are the Various Filters in AngularJS?


Filters in AngularJS are used to format data before
displaying it to the user. Common filters include:
1. Currency Filter: Formats a number as a
currency.
{{ amount | currency }}
2. Date Filter: Formats a date according to a
specified format.
{{ date | date:'short' }}
3. Filter Filter: Filters an array of data based on a
provided condition.
{{ items | filter:searchText }}
4. Json Filter: Converts an object into a JSON
string.
{{ object | json }}
5. Lowercase/Uppercase Filters: Transforms text
to lowercase or uppercase.
{{ text | lowercase }}
6. OrderBy Filter: Orders an array based on a
specified property.
{{ items | orderBy:'name' }}

You might also like