100% found this document useful (1 vote)
4K views23 pages

Web Designing Notes for BCA 4th Sem

Uploaded by

sahil gupta.
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
100% found this document useful (1 vote)
4K views23 pages

Web Designing Notes for BCA 4th Sem

Uploaded by

sahil gupta.
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

1

THEORY FILE : WEB DESIGNING (FULL NOTES: BY SAHIL ) .


SUBJECT CODE: UGCA: 1927

BACHELOR OF COMPUTER APPLICATIONS

MAINTAINED BY: TEACHER’S / MAM’:


Sahil Kumar Dr.

IL
COLLEGE ROLL NO: 226617

UNIVERSITY ROLL NO: 2200315

H
SA

DEPARTMENT OF COMPUTER SCIENCE ENGINEERING

BABA BANDA SINGH BAHADUR ENGINEERING

COLLEGE FATEGARH SAHIB


➖➖
2

Program BCA
Semester
Course Name ➖ 4th.
Web Designing (Theory).

UNIT ➖01
● Internet Basics


● Basic concepts, communicating on the internet, internet domains, internet server
identities, establishing connectivity on the internet client IP address

IL
Understanding the basic concepts of communicating on the internet, internet domains, internet
server identities, and establishing connectivity involves grasping fundamental principles of
networking and internet protocols. Here's an overview:

Basic Concepts:


1. Internet Protocol (IP):
H
I. The Internet Protocol (IP) is a set of rules that governs how data packets are transmitted
over the internet.
II. It provides addressing and routing capabilities, allowing devices to communicate with
each other across networks.

2. Transmission Control Protocol (TCP) and User Datagram Protocol (UDP): ➖


SA
I. TCP and UDP are protocols used in conjunction with IP to facilitate communication
between devices.
II. TCP provides reliable, connection-oriented communication, while UDP offers simpler,
connectionless communication.

3. Domain Name System (DNS): ➖


I. DNS translates domain names (e.g., [Link]) into IP addresses (e.g.,
[Link]) that computers use to communicate.
II. DNS enables users to access websites and services using human-readable domain
names.

Communicating on the Internet: ➖


1. Client-Server Model: ➖
I. The client-server model is a network architecture where clients request services from
servers.
II. Clients initiate communication by sending requests to servers, which respond with the
requested data or services.

3
2. Request-Response Cycle:
I. Communication between clients and servers typically follows a request-response pattern.
II. Clients send requests to servers, specifying the desired action or resource, and servers
respond with the requested data or status.

Internet Domains:

1. Domain Names: ➖
I. Domain names are human-readable labels used to identify websites, servers, and other
resources on the internet.
II. They consist of a hierarchical structure, with labels separated by dots (e.g.,
[Link]).

IL
2. Top-Level Domains (TLDs): ➖
I. TLDs are the highest level of the domain name system hierarchy.
II. Examples include .com, .org, .net, .edu, and country code TLDs like .uk, .de, and .jp.

Internet Server Identities: ➖


1. IP Addresses: ➖
H
I. IP addresses uniquely identify devices on a network.
II. They can be IPv4 addresses (e.g., [Link]) or IPv6 addresses (e.g.,
[Link]).

2. Server Certificates: ➖
I. Server certificates are used to establish the identity and authenticity of servers on the
SA
internet.
II. They are issued by trusted Certificate Authorities (CAs) and contain cryptographic keys
and information about the server.

Establishing Connectivity on the Internet: ➖


1. Client IP Address: ➖
I. The client IP address is the unique address assigned to a client device on a network.
II. It is used to identify the client device and route data packets to and from it on the internet.

2. TCP/IP Stack: ➖
I. The TCP/IP stack is a set of protocols used for communication over the internet.
II. It includes layers such as the application layer, transport layer (TCP/UDP), network layer
(IP), and link layer.

4
3. Socket Communication:
I. Socket communication allows applications to establish connections and exchange data
over the internet using TCP or UDP.
II. Clients and servers communicate through sockets, which represent endpoints for data
transmission.

Understanding these basic concepts is essential for navigating the complexities of internet
communication, domain resolution, server identification, and establishing connectivity between
clients and servers on the internet.

● Introduction To HTML ➖

IL
● Information Files Creation, Web Server, Web Client/Browser, Hyper Text
Markup Language (HTML Tags, Paired Tags, Singular Tags), Commonly Used Html
Commands (Document Head, Document Body), Title and Footer, Text Formatting


(Paragraph Breaks, Line Breaks), Emphasising Material in a Web Page (Heading Styles,
Drawing Lines)
H
To create information files for web pages, you'll need to understand the basics of web
development, including creating web pages using HTML (HyperText Markup Language), setting
up a web server to host your files, and using web browsers as clients to view those pages.
Here's a guide covering these topics along with some commonly used HTML tags and
commands for creating web content:



Creating Information Files:
SA
1. HTML Files:
I. HTML files are text files with the ".html" extension that contain the content and structure
of web pages.

2. Text Editors: ➖
I. You can create HTML files using plain text editors like Notepad (Windows), TextEdit
(Mac), or Visual Studio Code, Sublime Text, or Atom (cross-platform).


Web Server:
1. Setup:
I. You can set up a web server using software like Apache, Nginx, or Microsoft IIS.
II. Install the server software on your computer or use a web hosting service to host your
files.

2. Hosting Files: ➖
I. Place your HTML files in the appropriate directory on the server to make them accessible
via the internet.
5


Web Client/Browser:
1. Accessing Web Pages:
I. Use web browsers like Google Chrome, Mozilla Firefox, Safari, or Microsoft Edge to
access web pages hosted on web servers.
II. Enter the URL (Uniform Resource Locator) of the web page in the browser's address bar
to request the page from the server.


HyperText Markup Language (HTML):
1. HTML Tags:
I. HTML uses tags to define the structure and content of web pages.
II. Tags are enclosed in angle brackets (< >) and come in pairs (opening and closing tags) or
singularly.

IL
2. Paired Tags:➖
I. Paired tags consist of an opening tag and a closing tag, which surround the content they
affect.
II. Example: <p> for paragraph opening tag and </p> for paragraph closing tag.

3. Singular Tags: ➖
I. Singular tags stand alone and do not require a closing tag.
H
II. Example: <br> for line break tag.


Commonly Used HTML Commands:
1. Document Head:
I. <head>: Defines the head section of the document containing metadata.
II. <title>: Sets the title of the web page displayed in the browser's title bar.
SA
2. Document Body: ➖
I. <body>: Defines the body section of the document containing the visible content.

Title and Footer: ➖


I. <h1> to <h6>: Defines headings of various sizes.
II. <footer>: Defines a footer section for the document.

Text Formatting: ➖
I. <p>: Defines a paragraph.
II. <br>: Inserts a line break.
III. <hr>: Inserts a horizontal rule (line).

Emphasising Material: ➖
I. <em>: Emphasises text (typically displayed in italics).
II. <strong>: Indicates strong importance (typically displayed in bold).

6
Conclusion:
By understanding these concepts and using HTML tags and commands effectively, you can
create information files for web pages, set up a web server to host your files, and view those
pages using web browsers. HTML provides a versatile markup language for structuring and
formatting web content, allowing you to create visually appealing and interactive web pages.

● Basic Formatting Tags :

● HTML Basic Tags, Text Formatting (Paragraph Breaks, Line Breaks),


Emphasising Material in a Web Page (Heading Styles, Drawing Lines), Text Styles


(Bold, Italics, Underline), Other Text Effects (Centering (Text, Images etc.),
Spacing (Indenting Text), HTML Colour Coding

IL

Here's a breakdown of HTML basic tags and various text formatting elements commonly used in
web development:

HTML Basic Tags: ➖


I. <html>: Defines the root element of an HTML document.
II. <head>: Contains metadata about the document, such as title, links to stylesheets, and
scripts.
III. <title>: Sets the title of the document displayed in the browser's title bar.
IV.
V.
VI.
H
<body>: Contains the visible content of the document.
<p>: Defines a paragraph.
<br>: Inserts a single line break.
VII. <hr>: Inserts a horizontal rule (line).
VIII. <h1> to <h6>: Define headings of different levels (h1 being the most important).
SA

Text Formatting:
1. Paragraph Breaks:
Use <p> tags to separate content into paragraphs.

2. Line Breaks: ➖
Use <br> tags to insert line breaks within paragraphs.


Emphasising Material:
1. Heading Styles:
Use <h1> to <h6> tags for different heading levels to emphasise titles and headings.

2. Drawing Lines: ➖
Use <hr> tags to draw horizontal lines to separate content sections.
7


Text Styles:
1. Bold:
Use <strong> or <b> tags to make text bold.


Example: <strong>This text is bold</strong> or <b>This text is bold</b>.
2. Italics:
Use <em> or <i> tags to make text italic.
Example: <em>This text is italic</em> or <i>This text is italic</i>.

3. Underline: ➖
Use <u> tags to underline text.
Example: <u>This text is underlined</u>.

IL
Other Text Effects:

1. Centering: ➖
Use CSS styles or HTML attributes like align to centre text or images.
Example: <centre>This text is centred</centre> (deprecated in HTML5, use CSS instead).

2. Spacing (Indenting Text): ➖


Use CSS styles such as padding or margin to add spacing or indent text.

HTML Colour Coding:


1. Text Colour: ➖
H
Use CSS colour property to specify text colour.
Example: <p style="colour:red;">Red text</p>.


SA
2. Background Colour:
Use CSS background-colour property to specify background colour.
Example: <body style="background-colour:light blue;">.

Conclusion: ➖
These basic HTML tags and text formatting elements provide a foundation for structuring and
styling content in web pages. By using these tags effectively, you can create visually appealing
and well-organised web content. Remember to complement HTML with CSS for more advanced
styling and layout options.
➖02
8

UNIT

● Lists :


● Type of Lists (Unordered List (Bullets), Ordered Lists (Numbering), Definition Lists
:
In HTML, lists are a way to organise and structure content. There are three main types of lists:
unordered lists, ordered lists, and definition lists.

1. Unordered Lists (Bullets): ➖


Unordered lists are used to present items in no particular order. Each item in the list is preceded

IL
by a bullet point or some other marker.

Example: ➖
<ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ul>

This will display: -


● Item 1
H
● Item 2
● Item 3


SA
2. Ordered Lists (Numbering):
Ordered lists are used to present items in a specific sequence or order. Each item in the list is
automatically numbered sequentially.

Example:-
<ol>
<li>First item</li>
<li>Second item</li>
<li>Third item</li>
</ol>

This will display:-


1. First item
2. Second item
3. Third item

9
3. Definition Lists:
Definition lists are used to define terms and their corresponding definitions. Each term is usually
bolded, and its definition follows.

Example: ➖
<dl>
<dt>Term 1</dt>
<dd>Definition of Term 1</dd>
<dt>Term 2</dt>
<dd>Definition of Term 2</dd>
<dt>Term 3</dt>
<dd>Definition of Term 3</dd>

IL
</dl>

This will display:


● Term 1
Definition of Term 1
● Term 2
Definition of Term 2
● Term 3
Definition of Term 3

Conclusion: ➖
H
Lists in HTML are essential for organising and structuring content. Unordered lists are used for
items with no specific order, ordered lists for items in a sequence, and definition lists for defining
terms and their meanings. Understanding and effectively using these list types can improve the
SA
readability and organisation of your web content.

● Adding Graphics To Html Documents :


● Using The Border Attribute, Using The Width And Height Attribute, Using The Align
Attribute, Using The Alt Attribute

In HTML, various attributes can be used to control the appearance and behaviour of elements
on a web page. Here's how you can use the border, width, height, align, and alt attributes:

1. Using the border Attribute: ➖


The border attribute is used to specify the width of the border around an element.
Example:-
<img src="[Link]" border="1">
10
This will display an image with a border of 1 pixel width.

2. Using the width and height Attributes: ➖


The width and height attributes specify the width and height of an element, such as an image or
table cell.

Example:-
<img src="[Link]" width="100" height="100">

This will display an image with a width of 100 pixels and a height of 100 pixels.

3. Using the align Attribute: -

IL
The align attribute is used to specify the alignment of an element relative to its surrounding
content.
Example:-
<img src="[Link]" align="left">

This will align the image to the left of the surrounding content.

4. Using the alt Attribute: ➖


H
The alt attribute is used to provide alternative text for an element, typically used for accessibility
purposes or when the element cannot be displayed.

Example:-
<img src="[Link]" alt="Description of the image">
SA
This will display the alternative text if the image cannot be loaded or if the user is using a screen
reader.

Conclusion: ➖
These attributes provide additional control and functionality to HTML elements. The border
attribute adds a border around an element, width and height control the dimensions, align sets
the alignment, and alt provides alternative text. Proper use of these attributes can enhance the
appearance, accessibility, and usability of your web pages.

● Tables :

● Introduction (Header, Data rows, The Caption Tag), Using the Width and Border
Attribute, Using the Cell padding Attribute, Using the Cell spacing Attribute,


Using the BGCOLOR Attribute, Using the COLSPAN and ROWSPAN Attributes : :
:
In HTML, tables are used to organise and display data in rows and columns. Various attributes
can be used to control the appearance and behaviour of tables.
11
Here's how you can use these attributes effectively:

1. Introduction (Header, Data Rows, The Caption Tag):-


I. Header (<th>): Used to define header cells in a table.
II. Data Rows (<td>): Used to define regular data cells in a table.
III. The Caption Tag (<caption>): Used to add a title or caption to the table.

Example: ➖
<table>
<caption>Monthly Sales Report</caption>
<tr>
<th>Month</th>

IL
<th>Sales Amount</th>
</tr>
<tr>
<td>January</td>
<td>$5000</td>
</tr>
<tr>
<td>February</td>
<td>$6000</td>
</tr>
</table>
H
2. Using the Width and Border Attribute: ➖
I. Width: Specifies the width of the table.
SA
II. Border: Specifies the width of the border around the table.

Example:-
<table width="300" border="1">
<!-- Table content -->
</table>

3. Using the Cell Padding Attribute:-


The cellpadding attribute specifies the amount of space between the content of a cell and its
border.

Example:-
<table cellpadding="5">
<!-- Table content -->
</table>
12
4. Using the Cell Spacing Attribute:-
The cellspacing attribute specifies the amount of space between cells in a table.

Example:-
<table cellspacing="10">
<!-- Table content -->
</table>

5. Using the BGCOLOR Attribute:-


The bgcolor attribute sets the background colour of a table or individual cells.

Example:-

IL
<table bgcolor="lightgray">
<!-- Table content -->
</table>

6. Using the COLSPAN and ROWSPAN Attributes:-


I. COLSPAN: Specifies the number of columns a cell should span.
II. ROWSPAN: Specifies the number of rows a cell should span.
Example:-
<table border="1">
<tr>
H
<th colspan="2">Monthly Sales</th>
</tr>
<tr>
<td rowspan="2">January</td>
SA
<td>$5000</td>
</tr>
<tr>
<td>$6000</td>
</tr>
</table>

Conclusion:-
HTML table attributes like width, border, cellpadding, cellspacing, bgcolor, colspan, and rowspan
provide flexibility in controlling the appearance and structure of tables. By using these attributes
effectively, you can create visually appealing and well-organised tables to present your data
effectively on web pages.
13
● Linking Documents :


● Links (External Document References, Internal Document References), Image As
Hyperlinks

In HTML, links are used to navigate between web pages or to reference external documents.
You can create links to external documents, internal document references (anchors), and even
use images as hyperlinks. Here's how you can implement each:

1. External Document References:-


To create a link to an external document, you use the <a> (anchor) element with the href
attribute specifying the URL of the external document.

IL
Example:-
<a href="[Link] Example Website</a>

2. Internal Document References (Anchors):-


You can create internal links within the same document or to specific sections of another
document by using anchors (<a> elements with the name attribute).

Example (Link to a Section in the Same Document):-

...
H
<a href="#section2">Go to Section 2</a>

<h2 id="section2">Section 2</h2>

Example (Link to a Different Document):-


<a href="other_document.html#section3">Go to Section 3 in Other Document</a>
SA
3. Image As Hyperlinks:-
You can use images as hyperlinks by wrapping an <img> element inside an <a> element.

Example:-
<a href="[Link]
<img src="[Link]" alt="Example Image"> </a>

Conclusion:-
Links are a fundamental aspect of web development, allowing users to navigate between pages
and access external resources. By using the <a> element with appropriate attributes, you can
create external links, internal document references, and even use images as hyperlinks,
providing an interactive and engaging user experience on your website.
14
● Frames :


● Introduction to Frames: The<FRAMESET> tag, The <FRAME> tag, Targeting Named
Frames. DHTML: Cascading Style Sheets, Style Tag

1. The <FRAMESET> tag ➖


The <FRAMESET> tag is used to create a set of frames in an HTML document. Each frame is a
separate window that can display a different web page. The <FRAMESET> tag has a number of
attributes that can be used to control the size, position, and scrolling of the frames.

2. The <FRAME> tag ➖


The <FRAME> tag is used to create a single frame in an HTML document. The <FRAME> tag
has a number of attributes that can be used to control the URL, name, and scrolling of the

IL
frame.

3. Targeting Named Frames ➖


Named frames can be targeted by using the <A> tag's target attribute. This allows you to link to
a specific frame in an HTML document.

4. DHTML: Cascading Style Sheets ➖


Cascading Style Sheets (CSS) is a language that can be used to style HTML documents. CSS
H
can be used to control the appearance of text, images, and other elements in an HTML
document.

5. Style Tag ➖
The <STYLE> tag is used to insert CSS code into an HTML document. The <STYLE> tag can
be used to style the entire document or just a specific element.
SA
➖03
15

UNIT
Forms Used by a Web Site :

● The Form Object, The Form Object’s Methods (The Text Element, The Password
Element, The Button Element, The Submit (Button) Element, The Reset (Button)


Element, The Checkbox Element, The Radio Element, The Text Area Element, The
Select and Option Element, The Multi Choice Select Lists Element)

In HTML, the <form> element is used to create interactive forms that allow users to input data.
The form object represents this HTML form element in JavaScript, and it provides various
methods and properties to interact with form elements. Here's an overview of the form object

IL
and its methods, along with commonly used form elements:

The Form Object:-


The form object represents an HTML form element and allows you to interact with its elements
programmatically using JavaScript.

Methods:-
H
I. submit(): Submits the form.
II. reset(): Resets the form to its initial state, clearing all input fields.
III. focus(): Sets focus on the first input field of the form.
IV. checkValidity(): Checks whether the form data is valid according to HTML validation
constraints.
SA
Commonly Used Form Elements:

1. The Text Element: :-


<input type="text">: Used for single-line text input.

2. The Password Element: :-


<input type="password">: Used for password input fields (characters are masked).

3. The Button Element: ➖


<input type="button">: Creates a clickable button without any predefined behavior.

4. The Submit (Button) Element: ➖


<input type="submit">: Creates a submit button that submits the form data to the server.

5. The Reset (Button) Element: ➖


<input type="reset">: Creates a reset button that clears the form fields.
16
6. The Checkbox Element: –
<input type="checkbox">: Used for selecting one or more options from a list of choices.
7. The Radio Element: –
<input type="radio">: Used for selecting a single option from a list of mutually exclusive choices.

8. The Text Area Element: –


<textarea></textarea>: Used for multi-line text input.

9. The Select and Option Element: –


<select>: Creates a dropdown list.
<option>: Defines an option in a dropdown list.

IL
10. The Multi Choice Select Lists Element: –
<select multiple>: Creates a dropdown list that allows multiple selections.

Example: –
<form id="myForm">
<input type="text" name="username" placeholder="Username">
<input type="password" name="password" placeholder="Password">
<input type="submit" value="Submit">
H
<input type="reset" value="Reset">
<input type="button" value="Cancel" onclick="cancelForm()">
<textarea name="message" placeholder="Enter your message"></textarea>
<select name="cars">
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
SA
<option value="mercedes">Mercedes</option>
<option value="audi">Audi</option>
</select>
</form>

// Accessing the form object


var form = [Link]('myForm');

// Accessing form elements


var usernameInput = [Link]['username'];
var passwordInput = [Link]['password'];
var messageTextarea = [Link]['message'];
var carsSelect = [Link]['cars'];

// Form methods
[Link](); // Submit the form
[Link](); // Reset the form

17
Conclusion: The form object in JavaScript provides a way to interact with HTML forms
dynamically. By accessing form elements and using methods like submit() and reset(), you can
create interactive forms and handle user input effectively in web applications.

IL
H
SA
➖ 04
18

UNIT
Introduction to JavaScript :

● JS Introduction, Where To, Output, Statements, Syntax, Comments,


Variables, Operators, Arithmetic, Assignment, Data Types, Functions,
Objects, Events, Strings, String Methods, Numbers, Number Methods,
Arrays, Array Methods, Array Sort, Array Iteration, Dates, Date Formats,
Date Get Methods, Date Set Methods, Math, Random, Booleans,
Comparisons, Conditions, Switch, Loop For, Loop While, Break, Type


Conversion, Bitwise, RegExp, Errors, Scope, Hoisting, Strict Mode, JSON,
Forms, Forms API

IL
JavaScript (JS) is a versatile and widely-used programming language primarily known for its
role in web development. It's supported by all major web browsers and is essential for creating
dynamic, interactive web pages. Here's a comprehensive overview of various concepts and

features in JavaScript:
H
Introduction to JavaScript: –
JavaScript is a high-level, interpreted programming language that allows you to add dynamic
behaviour to web pages. It's primarily used for client-side scripting in web development but can
also be used for server-side development (with [Link]).

Where to Use JavaScript:


SA
JavaScript can be used: –
I. Within HTML documents using <script> tags.
II. In external JavaScript files (.js) linked to HTML documents.
III. In [Link] for server-side development.
IV. In frameworks and libraries like React, Angular, and [Link] for building complex web
applications.

Output in JavaScript:
JavaScript can output data to different sources, such as: –
I. The browser's console using [Link]().
II. Alert boxes using alert().
III. HTML documents using [Link]().
IV. HTML elements using DOM manipulation methods.

Statements and Syntax: –


JavaScript statements are instructions to be executed by the browser. Statements are
separated by semicolons (;). JavaScript syntax follows certain rules for writing valid code.
19
Comments: –
JavaScript supports single-line (//) and multi-line (/* */) comments for documenting code and
making it more readable.

Variables: –
Variables are containers for storing data values. JavaScript variables can hold various data
types, such as numbers, strings, objects, etc.

Operators: –
JavaScript supports various types of operators, including arithmetic, assignment, comparison,
logical, and bitwise operators.

IL
Data Types: –
JavaScript has several primitive data types, including numbers, strings, booleans, null,
undefined, and symbols. It also has complex data types like objects and arrays.

Functions: –
Functions are reusable blocks of code that perform a specific task. JavaScript functions can be
declared using the function keyword.

Objects: –
H
JavaScript is an object-oriented language, and objects are fundamental to its structure. Objects
in JavaScript are collections of key-value pairs.

Events: –
JavaScript allows you to handle events triggered by user interactions or browser actions. Event
SA
handling enables the creation of interactive web applications.

Strings and String Methods: –


Strings are sequences of characters. JavaScript provides numerous methods for working with
strings, such as toUpperCase(), substring(), indexOf(), etc.

Numbers and Number Methods: –


JavaScript handles numerical data, including integers and floating-point numbers. It offers
methods like toFixed(), toString(), parseInt(), etc., for working with numbers.

Arrays and Array Methods: –


Arrays are ordered collections of data. JavaScript arrays have built-in methods for manipulation,
such as push(), pop(), splice(), etc.

Array Sort and Iteration: –


JavaScript arrays can be sorted using methods like sort() and iterated over using loops or
methods like forEach() and map().
20
Dates and Date Methods: –
JavaScript provides a Date object for working with dates and times. Date methods allow you to
get and set various components of a date.

Maths and Random: –


The Math object in JavaScript provides mathematical functions and constants. It includes
methods for operations like rounding, exponentiation, trigonometry, etc.

Booleans, Comparisons, and Conditions: –


Booleans represent true or false values. JavaScript uses comparison operators (e.g., ==, ===,
<, >), conditional statements (e.g., if, else, switch), and logical operators (e.g., &&, ||, !) for
decision-making.

IL
Loops and Break: –
JavaScript supports different types of loops, such as for, while, and do-while. The break
statement is used to exit a loop prematurely.

Type Conversion: –
JavaScript automatically converts data types as needed, but explicit type conversion can also
be performed using functions like parseInt(), String(), etc.

Bitwise Operations: –
H
JavaScript supports bitwise operations for handling binary data at the bit level.

Regular Expressions (RegExp): –


Regular expressions are patterns used for matching character combinations in strings.
SA
JavaScript provides support for regular expressions through the RegExp object.

Errors and Exception Handling: –


JavaScript provides a built-in Error object for handling errors and exceptions. Exception
handling can be done using try, catch, and finally blocks.

Scope and Hoisting: –


JavaScript has function scope, meaning variables defined inside a function are not accessible
outside it. Hoisting is a JavaScript mechanism where variable and function declarations are
moved to the top of their containing scope during compilation.
Strict Mode: –
Strict mode is a JavaScript feature that enforces stricter parsing and error handling. It helps
prevent common coding mistakes and promotes cleaner code.

JSON (JavaScript Object Notation): –


JSON is a lightweight data-interchange format used for exchanging data between a server and
a web application. JavaScript provides built-in methods for parsing and stringifying JSON data.
21
Forms and Forms API: –
JavaScript can interact with HTML forms and their elements using the Forms API. It allows you
to access and manipulate form data, validate input fields, and handle form submissions.

Conclusion: –
JavaScript is a versatile programming language with a wide range of features and capabilities.
From basic data types and control structures to advanced concepts like objects, functions, and
events, JavaScript empowers developers to build interactive and dynamic web applications. By
mastering JavaScript, developers can create modern, engaging web experiences for users
across different platforms and devices.

IL

● JS Functions, Function Definitions, Function Parameters, Function Invocation,
Function Call, Function Apply, Function Closures

JavaScript functions are blocks of reusable code designed to perform a specific task. They allow
you to encapsulate logic, making your code modular and easier to manage. Here's an overview
of various aspects of JavaScript functions:

Function Definitions:
H
JavaScript functions can be defined using either function declarations or function expressions.

1. Function Declarations: –
function functionName(parameters) {
// Function body
}
SA
2. Function Expressions: –
var functionName = function(parameters) {
// Function body
};

Function Parameters: –
Functions in JavaScript can accept zero or more parameters, which are variables listed inside
the parentheses of the function definition. Parameters allow you to pass data into the function
when it is invoked.

Example: –
function greet(name) {
[Link]('Hello, ' + name + '!');
}

greet('John'); // Output: Hello, John!


22
Function Invocation (Function Call): –
Function invocation refers to calling or executing a function to perform its defined task.
Functions can be invoked by using their name followed by parentheses, optionally passing
arguments.

Example: –
function greet() {
[Link]('Hello, World!');
}
greet(); // Output: Hello, World!

Function Apply: –

IL
The apply() method in JavaScript allows you to call a function with a specified this value and an
array or array-like object as arguments.

Example: —
function sum(a, b) {
return a + b;
}

var numbers = [5, 10];


H
var result = [Link](null, numbers);
[Link](result); // Output: 15

Function Closures: —
A closure is a combination of a function and the lexical environment within which that function
SA
was declared. Closures allow functions to access variables from their outer scope even after the
outer function has finished executing.

Example: –
function outerFunction() {
var outerVariable = 'I am from outer function';
function innerFunction() {
[Link](outerVariable); // Access outerVariable from outer scope
}

return innerFunction;
}

var innerFunc = outerFunction();


innerFunc(); // Output: I am from outer function
23
Conclusion: —
JavaScript functions are fundamental building blocks of web development. They enable code
reusability, modularity, and encapsulation of logic. Understanding how to define functions, work
with parameters, invoke functions, apply them in different contexts, and utilise closures allows
you to write more efficient and maintainable JavaScript code.

HAPPY ENDING BY SAHIL RAUNIYAR

IL
H
SA

You might also like