WT U3 One shot Notes(Edushine Classes)
WT U3 One shot Notes(Edushine Classes)
Edushine Classes
Follow Us
Free Notes Available on : https://telegram.me/rrsimtclasses
https://telegram.me/rrsimtclasses/
Web Technology (BCS502)
Introduction :
• Javascript is a dynamic computer programming language.
• It is lightweight and most commonly used as a part of web pages, whose
implementations allow client-side script to interact with the user and
make dynamic pages.
• It is an interpreted programming language with object-oriented
capabilities.
• Java Script was developed by Netscape in 1995.
• JavaScript was first known as LiveScript, but Netscape changed its name
to JavaScript.
Follow U Free
s
R R Notes
S I M T CLASSES
Available WHATSAPP
on - 9795358008
: https://telegram.me/rrsimtclasses
Web Technology (BCS502)
Follow U Free
s
R R Notes
S I M T CLASSES
Available WHATSAPP
on - 9795358008
: https://telegram.me/rrsimtclasses
Web Technology (BCS502)
Follow U Free
s
R R Notes
S I M T CLASSES
Available WHATSAPP
on - 9795358008
: https://telegram.me/rrsimtclasses
Web Technology (BCS502)
JavaScript – Syntax :
• JavaScript can be implemented using JavaScript statements that
are placed within the <script> ... </script> tags.
• You can place the <script> tags, containing your JavaScript, anywhere
within your web page, but it is normally recommended that you should
keep it within the <head> tags.
Syntax - <script language="javascript" type="text/javascript" src="MyPage.js">
JavaScript code • Language – This attribute specifies what
<script> </script> scripting language you are using. Typically, its
JavaScript code value will be "javascript."
</script> • Type – This attribute is what is now
recommended to indicate the scripting
language in use, and its value should be set
to "text/javascript."
Follow U Free
s
R R Notes
S I M T CLASSES
Available WHATSAPP
on - 9795358008
: https://telegram.me/rrsimtclasses
Web Technology (BCS502)
Follow U Free
s
R R Notes
S I M T CLASSES
Available WHATSAPP
on - 9795358008
: https://telegram.me/rrsimtclasses
Web Technology (BCS502)
• Improves User Experience: Quick error messages help users corr ect
issues without waiting for a server response.
Common Types of Client-Side Validation –
1. Required Field Validation: Ensures that certain fields are not left empty.
html
Eg - <input type="text" required>
2. Data Type Validation: Checks if the entered data matches the expected type (e.g.,
numbers for age).
html
Eg - <input type="number">
3. Length Validation: Ensures the input is within a specific length range.
Html Eg - <input type="text" minlength="5" maxlength="10">
Follow U Free
s
R R Notes
S I M T CLASSES
Available WHATSAPP
on - 9795358008
: https://telegram.me/rrsimtclasses
Web Technology (BCS502)
Follow U Free
s
R R Notes
S I M T CLASSES
Available WHATSAPP
on - 9795358008
: https://telegram.me/rrsimtclasses
Web Technology (BCS502)
Follow U Free
s
R R Notes
S I M T CLASSES
Available WHATSAPP
on - 9795358008
: https://telegram.me/rrsimtclasses
Web Technology (BCS502)
function validateForm() {
let email = document.forms["myForm"]["email"].value;
if (email == "") {
alert("Email must be filled out");
return false;
The function checks if the email field is
}
empty and shows an alert if it is.
}
Follow U Free
s
R R Notes
S I M T CLASSES
Available WHATSAPP
on - 9795358008
: https://telegram.me/rrsimtclasses
Web Technology (BCS502)
Follow U Free
s
R R Notes
S I M T CLASSES
Available WHATSAPP
on - 9795358008
: https://telegram.me/rrsimtclasses
Web Technology (BCS502)
Follow U Free
s
R R Notes
S I M T CLASSES
Available WHATSAPP
on - 9795358008
: https://telegram.me/rrsimtclasses
Web Technology (BCS502)
Example –
1. If Statement –
let age = 18;
If age is 18 or more, it prints "You are an adult."
if (age >= 18) {
console.log("You are an adult.");
}
2. If – else Statement –
let age = 16;
If age is less than 18, it prints "You are a minor."
if (age >= 18) {
console.log("You are an adult.");
} else {console.log("You are a minor.");}
Follow U Free
s
R R Notes
S I M T CLASSES
Available WHATSAPP
on - 9795358008
: https://telegram.me/rrsimtclasses
Web Technology (BCS502)
Follow U Free
s
R R Notes
S I M T CLASSES
Available WHATSAPP
on - 9795358008
: https://telegram.me/rrsimtclasses
Web Technology (BCS502)
4. Switch Statement –
let day = "Monday";
switch (day) {
case "Monday": It Checks the value of day and prints a message
console.log("Start of the work week."); based on its value. If none of the cases match, it runs
break; the default case.
case "Friday":
console.log("End of the work week.");
break;
case "Saturday":
case "Sunday":
console.log("Weekend!");
break;
default:
console.log("Midweek day.");
}
Follow U Free
s
R R Notes
S I M T CLASSES
Available WHATSAPP
on - 9795358008
: https://telegram.me/rrsimtclasses
Web Technology (BCS502)
Follow U Free
s
R R Notes
S I M T CLASSES
Available WHATSAPP
on - 9795358008
: https://telegram.me/rrsimtclasses
Web Technology (BCS502)
Follow U Free
s
R R Notes
S I M T CLASSES
Available WHATSAPP
on - 9795358008
: https://telegram.me/rrsimtclasses
Web Technology (BCS502)
5. Null: Represents an intentional absence of any value.
let y = null;
6. BigInt: Represents large integers beyond the safe limit of Number.
let bigNumber = 1234567890123456789012345678901234567890n;
2. Non-Primitive Data Types (Objects) –
These are more complex and can hold multiple values.
1.Object: A collection of key-value pairs.
let person = {
name: "John",
age: 30
};
Follow U Free
s
R R Notes
S I M T CLASSES
Available WHATSAPP
on - 9795358008
: https://telegram.me/rrsimtclasses
Web Technology (BCS502)
2. Array: A special kind of object used to store a list of values.
let colors = ["red", "green", "blue"];
3. Function: A block of code designed to perform a particular task.
function greet() {
return "Hello!";
}
How JavaScript Handles Data Types –
let message = "Hi"; // It's a string
message = 123; // Now it's a number
Dynamic Typing: You don't need to specify the data type when you create a variable. JavaScript
automatically figures it out based on the value you assign.
javascript
Follow U Free
s
R R Notes
S I M T CLASSES
Available WHATSAPP
on - 9795358008
: https://telegram.me/rrsimtclasses
Web Technology (BCS502)
JavaScript Functions :
A function in JavaScript is like a small machine or a recipe that you
create to do a specific task. It takes some input (if needed), processes it,
and gives back a result or does something.
Follow U Free
s
R R Notes
S I M T CLASSES
Available WHATSAPP
on - 9795358008
: https://telegram.me/rrsimtclasses
Web Technology (BCS502)
How to Create a Function –
1. Function Declaration: You define a function using the
function keyword, give it a name, and write the steps inside
curly braces {}.
function greet() {
console.log("Hello, world!");
}
2. Function Expression: You can also store a function in a
variable.
const greet = function() {
console.log("Hello, world!");
};
Follow U Free
s
R R Notes
S I M T CLASSES
Available WHATSAPP
on - 9795358008
: https://telegram.me/rrsimtclasses
Web Technology (BCS502)
Follow U Free
s
R R Notes
S I M T CLASSES
Available WHATSAPP
on - 9795358008
: https://telegram.me/rrsimtclasses
Web Technology (BCS502)
Objects in JavaScript –
An object in JavaScript is a collection of related data and functionalities.
You can think of it like a real-world object, such as a car or a person,
which has properties (data) and methods (functions).
Why Use Objects?
1. Organization: Group related data and functions together.
2. Reusability: Easily reuse the same structure for similar things.
3. Flexibility: Store and manipulate complex data.
Follow U Free
s
R R Notes
S I M T CLASSES
Available WHATSAPP
on - 9795358008
: https://telegram.me/rrsimtclasses
Web Technology (BCS502)
Follow U Free
s
R R Notes
S I M T CLASSES
Available WHATSAPP
on - 9795358008
: https://telegram.me/rrsimtclasses
Web Technology (BCS502)
Follow U Free
s
R R Notes
S I M T CLASSES
Available WHATSAPP
on - 9795358008
: https://telegram.me/rrsimtclasses
Web Technology (BCS502)
Follow U Free
s
R R Notes
S I M T CLASSES
Available WHATSAPP
on - 9795358008
: https://telegram.me/rrsimtclasses
Web Technology (BCS502)
Follow U Free
s
R R Notes
S I M T CLASSES
Available WHATSAPP
on - 9795358008
: https://telegram.me/rrsimtclasses
Web Technology (BCS502)
Asynchronous in JavaScript -
In JavaScript, asynchronous means doing things in the background
without blocking the main program. This allows JavaScript to handle
tasks that take time, like fetching data from a server or reading a file,
without pausing other parts of your program.
Here’s an example to understand:
• Imagine you’re ordering pizza. While waiting for the delivery, you can
do other things, like watching TV or cleaning, instead of just sitting
idle. When the pizza arrives, the delivery person rings the doorbell,
and you handle it.
Follow U Free
s
R R Notes
S I M T CLASSES
Available WHATSAPP
on - 9795358008
: https://telegram.me/rrsimtclasses
Web Technology (BCS502)
AJAX Technologies -
• As described earlier, AJAX is not a technology but a group of inter-related
technologies. AJAX technologies include:
HTML/XHTML and CSS: These technologies are used for displaying
content and style. It is mainly used for presentation.
• DOM: It is used for dynamic display and interaction with data.
• XML or JSON: For carrying data to and from the server. JSON (JavaScript
Object Notation) is like XML but shorter and faster than XML.
• XMLHttpRequest: For asynchronous communication between client and
server.
• JavaScript: It is used to bring the above technologies together.
XMLHttpRequest -
• An object of XMLHttpRequest is used for asynchronous
communication between client and server.
• It performs the following operations:
• Sends data from the client in the background.
• Receives the data from the server.
• Updates the webpage without reloading it.
<!DOCTYPE html>
<html> // Send the request
<head> xhr.send();
<title>AJAX Example</title> }
<script> </script>
function loadData() { </head>
// Create an XMLHttpRequest object <body>
var xhr = new XMLHttpRequest(); <h1>AJAX Example</h1>
<button onclick="loadData()">Fetch Data</button>
// Define the type of request (GET) and the URL (data.txt) <div id="result"></div>
xhr.open('GET', 'data.txt', true); </body>
</html>
// Define what to do when the response is received
xhr.onreadystatechange = function() {
if (xhr.readyState == 4 && xhr.status == 200) {
// Update the content of the div with id "result"
document.getElementById('result').innerHTML = xhr.responseText; } };
Networking
IP Addressing- (V.IMP)
An IP (Internet Protocol) Address is a unique identifier assigned to each
device connected to a network. It acts like a postal address, ensuring data is
sent to the correct destination on the internet. Think of it as your computer’s
personal phone number that other devices use to find and communicate
with it.
There are two main versions of IP addresses:
1. IPv4: This is the older and more widely used format.
i. It consists of 32 bits and is usually written as four decimal numbers
separated by dots (e.g., 192.168.1.1).
ii. Each number ranges from 0 to 255.
Follow U Free
s
R R Notes
S I M T CLASSES
Available WHATSAPP
on - 9795358008
: https://telegram.me/rrsimtclasses
Web Technology (BCS502)
Classification of IP Addresses -
IP addresses are classified into different categories, primarily based on
their Class.
1. IP Address Classes (IPv4)
IPv4 addresses are divided into five classes: Class A, Class B, Class C, Class
D, and Class E. The first few bits of the IP address determine its class.
i. Class A
• Range: 1.0.0.0 to 126.255.255.255
• First Bit: Starts with 0.
• Purpose: Used for large networks with many devices.
• Default Subnet Mask: 255.0.0.0
• Number of Networks: 128 (2^7) networks.
• Number of Hosts per Network: Over 16 million (2^24 - 2) hosts.
Follow U Free
s
R R Notes
S I M T CLASSES
Available WHATSAPP
on - 9795358008
: https://telegram.me/rrsimtclasses
Web Technology (BCS502)
ii. Class B
• Range: 128.0.0.0 to 191.255.255.255
• First Bits: Starts with 10.
• Purpose: Used for medium-sized networks.
• Default Subnet Mask: 255.255.0.0
• Number of Networks: 16,384 (2^14) networks.
• Number of Hosts per Network: Over 65,000 (2^16 - 2) hosts.
iii. Class C
• Range: 192.0.0.0 to 223.255.255.255
• First Bits: Starts with 110.
• Purpose: Used for small networks.
• Default Subnet Mask: 255.255.255.0
• Number of Networks: 2 million (2^21) networks.
• Number of Hosts per Network: 254 (2^8 - 2) hosts.
Free Notes
RRSIMT CLASSES Available
WHATSAPP on : https://telegram.me/rrsimtclasses
– 9795358008 Follow us On
Web Technology (BCS502)
iv. Class D
• Range: 224.0.0.0 to 239.255.255.255
• First Bits: Starts with 1110.
• Purpose: Used for multicast groups (sending data to multiple
destinations).
• Subnet Mask: Not applicable.
v. Class E
• Range: 240.0.0.0 to 255.255.255.255
• First Bits: Starts with 1111.
• Purpose: Reserved for experimental purposes.
• Subnet Mask: Not applicable.
Free Notes
RRSIMT CLASSES Available
WHATSAPP on : https://telegram.me/rrsimtclasses
– 9795358008 Follow us On
Web Technology (BCS502)
InetAddress Class
The InetAddress class in Java is part of the java.net package and is
used to represent an IP address. It provides methods to work
with both IPv4 and IPv6 addresses. This class allows you to
resolve hostnames to IP addresses and vice versa.
Main Uses of InetAddress:
i. Resolving hostnames to IP addresses: For example,
converting "www.google.com" to its corresponding IP
address.
ii. Resolving IP addresses to hostnames: Converting an IP
address back to its hostname.
Free Notes
RRSIMT CLASSES Available
WHATSAPP on : https://telegram.me/rrsimtclasses
– 9795358008 Follow us On
Web Technology (BCS502)
Free Notes
RRSIMT CLASSES Available
WHATSAPP on : https://telegram.me/rrsimtclasses
– 9795358008 Follow us On
Web Technology (BCS502)
2. getByName(String host):
• Purpose: This method returns the InetAddress object for a given
hostname or IP address.
Example -
InetAddress address = InetAddress.getByName("www.google.com");
System.out.println("IP Address: " + address); • It looks up the IP address for
a given hostname. If you pass
an IP address, it will directly
return the corresponding
InetAddress object.
Follow us O Free
R R SNotes
n I M T Available
CLASSES onWHATSAPP
: https://telegram.me/rrsimtclasses
– 9795358008
Web Technology (BCS502)
3. getAllByName(String host):
• Purpose: This method returns an array of InetAddress objects for a given
hostname.
Example –
InetAddress[] addresses = InetAddress.getAllByName("www.google.com");
for (InetAddress address : addresses) {
System.out.println(address);
}
Some hostnames (especially large websites) can be associated
with multiple IP addresses for load balancing. This method
returns all the IP addresses associated with the hostname.
Follow us O Free
R R SNotes
n I M T Available
CLASSES onWHATSAPP
: https://telegram.me/rrsimtclasses
– 9795358008
Web Technology (BCS502)
4. getByAddress(byte[] addr):
• Purpose: This method returns an InetAddress object for a given raw IP
address in the form of a byte array.
Example –
byte[] ipAddr = {127, 0, 0, 1};
InetAddress address = InetAddress.getByAddress(ipAddr);
System.out.println("Address: " + address);
Follow us O Free
R R SNotes
n I M T Available
CLASSES onWHATSAPP
: https://telegram.me/rrsimtclasses
– 9795358008
Web Technology (BCS502)
Follow us O Free
R R SNotes
n I M T Available
CLASSES onWHATSAPP
: https://telegram.me/rrsimtclasses
– 9795358008
Web Technology (BCS502)
Instance Methods -
Instance methods are methods that belong to an object of a class.
These methods can use and manipulate the data (fields or variables)
that belong to the object.
Key Points About Instance Methods:
1. Accessing Data: Instance methods can directly access and modify
the instance variables of the object.
2. Need an Object: To call an instance method, you need to create an
instance (object) of the class.
3. Defined with No static: They are defined without the static keyword.
// Instance method
public void setSpeed(int newSpeed) {
speed = newSpeed; // Updates the speed of this particular car
}
// Instance method
public void displayDetails() {
System.out.println("Brand: " + brand + ", Speed: " + speed);
}
}
What is a Socket?
A socket is like a plug that allows a program on your device to connect to
another device over a network.
A client socket is used by the device that is initiating the connection (the
client).
How TCP/IP Client Socket Works:
i. Creating a Socket: The client creates a socket to start the connection.
ii. Connecting to the Server: The client socket uses the server's IP address
and port number to establish a connection.
iii. Sending and Receiving Data: Once connected, the client can send data
to the server and receive responses.
iv. Closing the Connection: After communication is done, the client closes the socket.
Free Notes Available on : https://telegram.me/rrsimtclasses
Web Technology (BCS502)
A Server Socket listens for requests from clients. Once a request is received,
it establishes a connection and allows data to be sent back and forth.
Socket Programming –
Socket programming is a way of enabling communication between two
computers (or devices) over a network. It allows these devices to send and
receive data, like chatting or exchanging files, using the internet or any
network.
What is a Socket?
A socket is like a phone line that connects two computers, allowing them to
talk to each other.
Free Notes Available on : https://telegram.me/rrsimtclasses
Web Technology (BCS502)
It has two main parts:
IP Address: The address of the computer on the network.
Port Number: A specific endpoint on the computer where the
connection happens.
What is Datagram -
A datagram is a small, self-contained packet of data that is sent over a
network. It's a key part of the User Datagram Protocol (UDP), which is a
way of sending information between computers. Unlike a phone call
(which is continuous and connected), sending a datagram is like sending a
postcard. You send it out, and it gets to the destination without needing a
direct connection.
4. Simple Structure:
1.Each datagram contains all the information needed to get it to the
destination, such as the destination address and data. It’s like a
postcard that has the address and message all in one.
5. Small Size:
1.Datagrams are typically small and can be easily sent over the network,
making them suitable for applications like online games, voice calls, or
video streaming where speed is important.
Thank You…