Web Cat 2
Web Cat 2
1.
a)Document object:
getElementById(id): It enables one to access and manipulate an HTML element on the web page by its
unique ID: e.g- var newId = document.getElementById("firstid");
createElement(tagName): It allows one to dynamically create HTML elements and add them to the
document: e.g- var newDiv = document.createElement("div");
Window object:
open(url, name, specs, replace): This method of the Window object opens a new browser window.
window.open("https://www.facebook.com");
alert(message): This method of the Window object displays a dialog box with a message.
window.alert("Hello, world!");
b) Handling of data: -Underscore.js: It includes functions for iterating over arrays and objects,
manipulating collections
Animations: -GreenSock Animation Platform (GSAP): GSAP is a powerful animation library that allows
you to create complex animations with ease.
Manipulation of forms: -Formik: Formik is a popular form management library for React applications. It
simplifies the process of building and managing complex forms by handling form state, validation, and
submission.
var person = {
name: "Raj",
age: 30,
city: "Bombay"
};
console.log(person);
Constructor function:
this.name = name;
this.age = age;
this.city = city;
}
var person1 = new Person("Raj", 30, "Bombay");
console.log(person1);
d) 2-Tiered Architecture: Typically, it consists of two tiers: the Presentation tier (Client) and the Data
Storage tier (Database) while 3-Tiered Architecture: consists of three tiers: the Presentation tier (Client),
the Application tier (Server), and the Data Storage tier (Database).In a 2-tiered architecture the three
layers of an application run on the two tiers while in 3 tier architecture the three layers of the application
run separately on the three tiers.
2.
<html>
<head>
</head>
<body>
</form>
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$name = $_POST['name'];
$address = $_POST['address'];
$telephone = $_POST['telephone'];
$meter = $_POST['meter'];
$prev_reading = $_POST['prev_reading'];
$curr_reading = $_POST['curr_reading'];
} else {
?>
</body>
</html>