WEB APPLICATION
The Internet
Basic of internet : The internet is a global network of interconnected computers and
devices that use standardized communication protocols to share information and
resources. The internet is based on the TCP/IP protocol suite and includes various
technologies such as email, the World Wide Web, and instant messaging.
File transfer : File transfer refers to the process of sending and receiving files over the
internet. One common method of file transfer is the File Transfer Protocol (FTP),
which allows users to transfer files between computers using a client-server
architecture.
Telnet : Telnet is a protocol that enables users to connect to remote computers and
access command-line interfaces. Telnet is primarily used for remote administration and
troubleshooting of computer systems.
Usenet : Usenet is a decentralized network of discussion groups that is used for
sharing information and engaging in discussions on various topics. Usenet predates the
World Wide Web and is still in use today.
Gopher : Gopher is a protocol that was used for organizing and retrieving information
on the internet before the World Wide Web became popular. Gopher is a text-based
system that organizes information in a hierarchical manner.
WAIS : WAIS (Wide Area Information Server) is a protocol that enables users to search
for and retrieve information from distributed databases over the internet. WAIS was
popular in the early days of the internet but has been largely replaced by other
technologies.
Archie and Veronica : Archie and Veronica were early search engines that were used
to locate files on the internet. Archie searched for files on FTP servers, while Veronica
searched for files on Gopher servers. These search engines have been largely
superseded by modern search engines like Google.
Internet Protocols
HTTP : Hypertext Transfer Protocol (HTTP) is a protocol used for transferring data
over the World Wide Web. It is the foundation of data communication on the web and
allows clients to communicate with servers by requesting and receiving resources,
such as web pages and multimedia content.
FTP : File Transfer Protocol (FTP) is a protocol used for transferring files between
computers over the internet. FTP uses a client-server architecture and allows users to
upload, download, and manage files on remote servers.
SMTP : Simple Mail Transfer Protocol (SMTP) is a protocol used for sending and
receiving email messages over the internet. SMTP is a client-server protocol that
allows users to send email messages from their email clients to an email server, which
then forwards the messages to their intended recipients.
World Wide Web
Elements of the Web : The World Wide Web is made up of various components,
including web servers, web browsers, and web pages. Web pages are written in HTML
and can include various elements such as text, images, links, and multimedia.
Web browser and its architecture : A web browser is a software application that is
used to access and view web pages on the internet. A browser consists of various
components, including the user interface, the rendering engine, and the networking
component.
The web server : A web server is a software application that is used to store and serve
web pages over the internet. When a user requests a web page, the web server sends
the page to the user's browser, which then renders the page.
The proxy server : A proxy server is an intermediary server that is used to access web
pages on behalf of a user. When a user requests a web page, the request is sent to the
proxy server, which then retrieves the page and sends it back to the user's browser.
Microsoft Internet Explorer : Microsoft Internet Explorer was a web browser
developed by Microsoft. It was one of the most popular web browsers in the world
until it was replaced by Microsoft Edge.
Viewing pages with a browser : To view a web page with a browser, the user enters
the URL of the page into the browser's address bar. The browser then sends a request
to the web server for the page, and the server sends the page back to the browser,
which then renders the page.
Using a browser for mail, news, and chat : Many web browsers include additional
features, such as email clients, news readers, and chat clients. These features allow
users to access these services directly from their browser, without needing to use
separate software applications.
Security and Privacy issues :
Cookies : Cookies are small pieces of data that are stored on a user's computer by a
website. They are commonly used for tracking user behavior, personalizing content, and
maintaining user sessions. However, cookies can also be used for malicious purposes, such
as tracking users across multiple websites or stealing sensitive information.
Firewall : A firewall is a security system that is used to protect a network from
unauthorized access. Firewalls can be implemented as software or hardware devices and
can block incoming and outgoing network traffic based on predefined rules.
Data Security : Data security is the practice of protecting digital information from
unauthorized access, theft, or corruption. This can include measures such as encryption,
access controls, backups, and disaster recovery planning.
Executable Applets and Scripts : Applets and scripts are small programs that are
embedded in web pages and executed by web browsers. While these programs can
enhance the functionality of web pages, they can also be used to execute malicious code,
such as viruses or malware.
Blocking System : Blocking systems are software applications or hardware devices that
are used to prevent access to certain websites, content, or applications. These systems are
often used in educational or corporate settings to restrict access to inappropriate or
distracting content.
HTML Fundamentals
Introduction : HTML stands for Hypertext Markup Language, it is the standard markup
language used to create web pages. It is a simple and widely used language that allows
developers to create structured documents by defining different elements and their
properties.
HTML Elements : HTML elements are the basic building blocks of HTML pages. They
define the structure and content of a web page, including text, images, and other
media. Some common HTML elements include headings, paragraphs, lists, links,
images, and forms.
HTML Semantics : HTML semantics refers to the meaning and structure of HTML
elements. By using semantically correct HTML, developers can make web pages more
accessible, SEO-friendly, and easier to maintain. For example, using the <header> tag
to define the header section of a web page instead of using a <div> element with a
class.
HTML 5 : HTML5 is the latest version of HTML, released in 2014. It introduces new
features and improvements to the language, including support for multimedia content,
better semantic elements, and improved form controls.
Doc Types : Doc Types, or Document Types, are used to specify the version of HTML
used in a web page. This information is used by web browsers to determine how to
display the web page. The most common Doc Type for HTML5 is <!DOCTYPE html>.
New Structure Tags : HTML5 introduced new structural tags to improve the
semantics of web pages. Some of these tags include <header>, <nav>, <section>,
<article>, <aside>, <footer>, and <main>. These tags help developers create more
meaningful and accessible web pages.
Section : The <section> tag is used to define a section or group of related content in a
web page. It is a semantic tag that helps to structure the content of a web page and
improve its accessibility.
Syntax : <section></section>
Nav : The <nav> tag is used to define a navigation section in a web page. It is typically
used to contain links to other pages or sections within the same page.
Syntax : <nav></nav>
Article : The <article> tag is used to define an independent piece of content that can
stand on its own in a web page. It is commonly used for blog posts, news articles, and
other types of content.
Syntax : <article></article>
Aside : The <aside> tag is used to define content that is related to the main content of
a web page, but not necessarily essential to it. It is commonly used for sidebars,
callouts, and other types of supplementary content.
Syntax : <aside></aside>
Header : The <header> tag is used to define the header section of a web page. It
typically contains branding, navigation, and other important information.
Syntax : <header></header>
Footer : The <footer> tag is used to define the footer section of a web page. It
typically contains copyright information, links to legal pages, and other footer content.
Syntax : <footer></footer>
HTML Attributes : HTML attributes are used to specify additional information about
HTML elements. They are used to modify the behavior or appearance of an element.
Examples of HTML attributes include the "class" attribute, which is used to specify a
class name for an element, and the "src" attribute, which is used to specify the source
of an image.
Headings : HTML headings are used to define headings and subheadings in a web
page. There are six levels of headings in HTML, from <h1> (the most important
heading) to <h6> (the least important heading).
Syntax : <h1></h1> to <h6></h6>
Paragraphs : HTML paragraphs are used to define blocks of text in a web page. They
are created using the <p> tag and can include other HTML elements, such as images
and links.
Syntax : <p></p>
Styles : Styles are used to define the presentation of an HTML element. They can be
defined inline using the style attribute, internally in the head section using the style
tag, or externally in a separate CSS file.
Syntax : <style></style>
Quotations : There are two types of quotations in HTML: blockquote and q.
blockquote is used to quote a longer piece of text, while q is used to quote a shorter
piece of text.
Syntax : <q></q> and <blockquote></blockquote>
Blocks : Block-level elements are elements that take up the full width of their
container and start on a new line. Examples include div, p, h1-h6, and ul.
Syntax : <div></div>
Classes : Classes are used to apply styles or other attributes to multiple elements.
They are defined using the class attribute and can be styled using CSS.
Layout : Layout refers to the way elements are positioned and arranged on a webpage.
It can be achieved using CSS properties such as display, position, float, and flexbox.
Iframes : An iframe is an HTML element used to embed another HTML document
within the current document. It is defined using the <iframe> tag.
Syntax : <iframe></iframe>
Creating HTML Pages : To create an HTML page, you need to create a text file and
save it with a .html extension. The file should contain the HTML markup, including the
doctype, html, head, and body tags.
Incorporating Horizontal Rules and Graphical Elements : Horizontal rules can be
created using the <hr> tag, and graphical elements can be added using the <img> tag.
Syntax : <hr> and <img>
Hyperlinks : Hyperlinks are used to link to other pages or resources. They are created
using the <a> tag and can be styled using CSS.
Syntax : <a></a>
Creating HTML Tables : Tables are used to display data in a structured format. They
are created using the <table>, <tr>, <th>, and <td> tags.
Syntax : <table></table>
Creating HTML Forms : Forms are used to collect user input. They are created using
the <form> tag and include various input elements such as <input>, <textarea>, and
<select>.
Syntax : <form></form>
HTML and Image Techniques : Image techniques include optimizing images for the
web, using responsive images, and adding alternative text for accessibility. Images are
added using the <img> tag.
HTML and Page : HTML is the markup language used to create web pages. A webpage
is a document that is displayed in a web browser and contains HTML markup.
Development of Website and Webpage : The development of a website and webpage
involves several steps and processes that include:
Planning : In this phase, the website's goals, target audience, content, and structure are
defined. It also involves selecting the appropriate technologies and tools for creating the
website.
Navigation and Themes : Navigation refers to the system of links that helps visitors move
from one page to another within a website. Themes refer to the visual design and layout
of the website.
Elements of a Web page : These include various HTML tags, such as headings, paragraphs,
images, and links, that are used to create the content and structure of web pages.
d. Steps of creating a site: This involves the actual creation of web pages using HTML,
CSS, and other programming languages. The process includes designing the layout,
creating and formatting content, and adding functionality such as forms and interactive
elements.
Publishing : Once the website is complete, it needs to be uploaded to a web server so that
it can be accessed by visitors over the internet. This involves selecting a web hosting
provider, registering a domain name, and uploading the website files.
Publicizing and structuring the website : This involves making the website visible to
search engines, optimizing it for search engines (SEO), and promoting it through social
media and other online channels. It also involves organizing the content on the website in
a way that makes it easy for visitors to find what they are looking for.
Cascading Style Sheets
Understanding Style Sheets : Cascading Style Sheets, or CSS, is a language used for
describing the presentation of a document written in HTML or XML. CSS allows you to
separate the style and layout of your web pages from the content of your web pages.
This makes it easier to maintain and update the design of your website. With CSS, you
can specify the fonts, colors, layout, and other visual elements of your web pages.
CSS Syntax : The syntax of CSS consists of a selector, which specifies the HTML
element you want to style, and a declaration block, which contains one or more
declarations that define the style of the element. A declaration consists of a property
and a value, separated by a colon.
Syntax : selector {
ㅤㅤㅤㅤ ㅤ property: value;
ㅤㅤㅤㅤ }
Applying Style Sheets to HTML document : To apply a CSS style sheet to an HTML
document, you can either include the styles directly in the HTML document using the
<style> element, or you can link to an external CSS file using the <link> element. The
<style> element should be placed in the <head> section of the HTML document, while
the <link> element can be placed in the <head> or <body> section.
Developing Style Sheets :
Inline : Inline styles are styles that are applied directly to an HTML element, using the
"style" attribute. This means that the style is specified within the tag itself, rather than in a
separate style sheet. Inline styles take precedence over internal and external styles.
Syntax : <tagname style="property: value;">
Internal : Internal styles are styles that are defined within the head section of an HTML
document, using the "style" tag. This allows you to define styles that are specific to that
document only. Internal styles take precedence over external styles, but not over inline
styles.
Syntax : <head>
ㅤㅤㅤㅤㅤㅤ <style>
ㅤㅤㅤㅤㅤㅤㅤㅤ selector {
ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ property: value;
ㅤㅤㅤㅤㅤㅤㅤㅤ }
ㅤㅤㅤㅤㅤㅤ </style>
ㅤㅤㅤㅤ </head>
External : External styles are styles that are defined in an external file with a .css
extension. This allows you to separate the presentation of your web pages from their
content. External styles can be linked to multiple HTML documents, making it easy to
apply consistent styling across a whole website. External styles take precedence over
internal and inline styles.
Syntax : <head>
ㅤㅤㅤㅤㅤㅤ <link rel="stylesheet" type="text/css" href="style.css">
ㅤㅤㅤㅤ </head>
CSS Selectors : They are used to select and style HTML elements.
Element selector : targets all instances of a specific HTML element.
Syntax : element {
ㅤㅤㅤㅤㅤㅤ property: value;
ㅤㅤㅤㅤ }
Class selector : targets elements with a specific class attribute.
Syntax : .class {
ㅤㅤㅤㅤㅤㅤ property: value;
ㅤㅤㅤㅤ }
id selector : targets a specific element with a unique id attribute.
Syntax : #id {
ㅤㅤㅤㅤㅤㅤ property: value;
ㅤㅤㅤㅤ }
Attribute selector : targets elements with a specific attribute value.
Syntax : [attribute=value] {
ㅤㅤㅤㅤㅤㅤ property: value;
ㅤㅤㅤㅤ }
Pseudo-class selector : targets elements in a specific state, such as when hovered over.
Syntax : :pseudo-class {
ㅤㅤㅤㅤㅤㅤ property: value;
ㅤㅤㅤㅤ }
<div> tag : The <div> tag is a container element that is used to group other HTML
elements together. The <div> tag does not have any inherent styling, but it can be
styled using CSS.
Syntax : <div class="container" id="main">
ㅤㅤㅤㅤㅤㅤ <!-- content goes here -->
ㅤㅤㅤㅤ </div>
Using class and id : Classes and ids are used to apply CSS styles to specific elements
on a webpage.
Syntax : <!-- using a class -->
ㅤㅤㅤㅤ <div class="class-name">
ㅤㅤㅤㅤㅤㅤ <!-- content goes here -->
ㅤㅤㅤㅤ </div>
ㅤㅤㅤㅤ<!-- using an id -->
ㅤㅤㅤㅤ<div id="id-name">
ㅤㅤㅤㅤㅤㅤ<!-- content goes here -->
ㅤㅤㅤㅤ</div>
ㅤㅤㅤㅤ<style>
ㅤㅤㅤㅤㅤㅤ.class-name {
ㅤㅤㅤㅤㅤㅤㅤㅤproperty: value;
ㅤㅤㅤㅤㅤㅤ}
ㅤㅤㅤㅤㅤㅤ#id-name {
ㅤㅤㅤㅤㅤㅤㅤㅤproperty: value;
ㅤㅤㅤㅤㅤㅤ}
ㅤㅤㅤㅤ</style>
Styling Backgrounds : You can use CSS to add background colors, images, and other
effects to HTML elements.
Syntax : background-color: value;
ㅤㅤㅤㅤ background-image: url("value");
Styling borders : CSS can be used to add borders to HTML elements.
Syntax : border: width style color;
Styling Text : CSS can also be used to style text on a webpage.
Syntax : font-family: value;
ㅤㅤㅤㅤ font-size: value;
ㅤㅤㅤㅤ color: value;
ㅤㅤㅤㅤ font-weight: value;
ㅤㅤㅤㅤ font-style: value;
Styling Links : Links can be styled using CSS to make them stand out or fit in with the
design of a webpage.
Syntax : a:link {
ㅤㅤㅤㅤㅤㅤ color: blue;
ㅤㅤㅤㅤ }
ㅤㅤㅤㅤa:hover {
ㅤㅤㅤㅤㅤㅤcolor: red;
ㅤㅤㅤㅤ}
Styling Lists : CSS can be used to style HTML lists, including unordered (bulleted) lists
and ordered (numbered) lists.
Syntax : ul {
ㅤㅤㅤㅤㅤㅤ list-style-type: circle;
ㅤㅤㅤㅤ }
ㅤㅤㅤㅤol {
ㅤㅤㅤㅤㅤㅤlist-style-type: decimal;
ㅤㅤㅤㅤ}
Styling Tables :
Syntax : table {
ㅤㅤㅤㅤㅤㅤ border-collapse: collapse;
ㅤㅤㅤㅤㅤㅤ width: 100%;
ㅤㅤㅤㅤ }
ㅤㅤㅤㅤth, td {
ㅤㅤㅤㅤㅤㅤtext-align: left;
ㅤㅤㅤㅤㅤㅤpadding: 8px;
ㅤㅤㅤㅤㅤㅤbackground-color: #000;
ㅤㅤㅤㅤㅤㅤcolor: #fff;
ㅤㅤㅤㅤ}
Styling Margins :
Syntax : selector {
ㅤㅤㅤㅤㅤㅤ margin-top: 10px;
ㅤㅤㅤㅤㅤㅤ margin-right: 20px;
ㅤㅤㅤㅤㅤㅤ margin-bottom: 30px;
ㅤㅤㅤㅤㅤㅤ margin-left: 40px;
ㅤㅤㅤㅤㅤㅤ margin: 10px 20px 30px 40px;
ㅤㅤㅤㅤ }
Styling Flexbox :
Syntax : .container {
ㅤㅤㅤㅤㅤㅤ display: flex;
ㅤㅤㅤㅤㅤㅤ flex-direction: row;
ㅤㅤㅤㅤㅤㅤ justify-content: center;
ㅤㅤㅤㅤㅤㅤ align-items: center;
ㅤㅤㅤㅤ }
ㅤㅤㅤㅤ.item {
ㅤㅤㅤㅤㅤㅤflex: 1;
ㅤㅤㅤㅤ}
Styling Grids :
Syntax : .container {
ㅤㅤㅤㅤㅤㅤ display: grid;
ㅤㅤㅤㅤㅤㅤ grid-template-columns: repeat(3, 1fr);
ㅤㅤㅤㅤㅤㅤ grid-template-rows: repeat(2, 1fr);
ㅤㅤㅤㅤㅤㅤ gap: 10px;
ㅤㅤㅤㅤ }
ㅤㅤㅤㅤ.item {
ㅤㅤㅤㅤㅤㅤgrid-column: 1 / 3;
ㅤㅤㅤㅤㅤㅤgrid-row: 1 / 2;
ㅤㅤㅤㅤ}
Bootstrap & Webpage design
CMS : CMS stands for Content Management System, which is a software application
that allows users to create, manage, and publish digital content. A CMS typically
includes a web-based publishing interface, database, and templates for content
display.
Banks of CMS : There are many CMS platforms available, including open-source and
proprietary options. Some popular open-source CMS platforms include WordPress,
Joomla, and Drupal. Proprietary CMS platforms include Adobe Experience Manager,
Sitecore, and HubSpot.
Joomla / wordpress - Installation : Both Joomla and WordPress are popular open-
source CMS platforms. To install Joomla or WordPress, you need to have a web server
that supports PHP and a MySQL database. You can download the installation files
from their respective websites and follow the installation instructions.
Design : Web design involves creating the visual and functional elements of a website,
including the layout, color scheme, typography, and user interface. The design should
be user-friendly and accessible, with clear navigation and easy-to-read content.
Development of websites : Web development involves creating the backend
functionality of a website, including coding, database management, and server
configuration. The development process can include building custom applications,
integrating third-party tools, and optimizing performance and security.
Javascript
Introduction : JavaScript is a high-level, dynamic, and interpreted programming
language that is used primarily for creating dynamic and interactive web pages. It is a
scripting language, which means that it is executed in real-time by web browsers on
client-side.
Client Side Scripting : Client-side scripting is a type of scripting that is performed by
the user's web browser rather than on the web server. JavaScript is one of the most
popular client-side scripting languages used for creating interactive web pages.
Memory Concepts : JavaScript uses dynamic memory allocation, which means that
memory is allocated automatically as needed during the execution of the script.
JavaScript also features garbage collection, which frees up memory that is no longer
being used by the script.
Arithmetic Decision Making : JavaScript supports arithmetic operations like addition,
subtraction, multiplication, and division, as well as more complex operations like
modulus and exponentiation. Decision making can be achieved through the use of
conditional statements like if/else, switch/case, and ternary operators.
Arithmetic operations :
ㅤ Addition : +
ㅤ Subtraction : -
ㅤ Multiplication : *
ㅤ Division : /
ㅤ Modulus (remainder) : %
Comparison operators :
ㅤEqual to : ==
ㅤNot equal to : !=
ㅤGreater than : >
ㅤLess than : <
ㅤGreater than or equal to : >=
ㅤLess than or equal to : <=
Logical operators :
ㅤ AND : &&
ㅤ OR : ||
ㅤ NOT : !
JavaScript Control Structures : JavaScript control structures are used to control the
flow of execution in a script. These include loops (for, while, do-while), conditional
statements (if/else, switch/case), and try/catch/finally blocks.
If / else statement :
if (condition) {
ㅤㅤ // code to be executed if condition is true
} else {
ㅤㅤ // code to be executed if condition is false
}
Switch statement :
switch (expression) {
ㅤㅤ case value1:
ㅤㅤㅤㅤ // code to be executed if expression matches value1break;
ㅤㅤ case value2:
ㅤㅤㅤㅤ // code to be executed if expression matches value2break;
ㅤㅤ default:
ㅤㅤㅤㅤ // code to be executed if expression doesn't match any case
}
For loop :
for (initialization; condition; increment) {
ㅤㅤ // code to be executed in each iteration
}
While loop :
while (condition) {
ㅤㅤ // code to be executed while condition is true
}
Do / while loop :
do {
ㅤㅤ // code to be executed at least once
} while (condition);
JavaScript Functions : Functions in JavaScript are blocks of code that can be called
and executed multiple times throughout a script. They can be defined using the
function keyword or using arrow functions, and can accept arguments and return
values.
Function definition :
function functionName(parameters) {
ㅤㅤ // code to be executed
ㅤㅤ return result; // optional
}
Function call :
functionName(arguments);
JavaScript Popup Boxes : Popup boxes are dialog boxes that appear on a web page in
response to a user action, like clicking a button or link. JavaScript provides several
types of popup boxes, including alert boxes, confirm boxes, and prompt boxes.
Alert box : alert(message);
Confirm box : confirm(message);
Prompt box : prompt(message, defaultValue);
Events : JavaScript events are actions or occurrences that happen on a web page, like
a button being clicked or a page being loaded. JavaScript can be used to detect these
events and trigger actions in response, like displaying a message or updating the page
content.
Syntax : element.addEventListener(eventType, eventHandler);
Event types : click, submit, keydown, mouseover & etc.
Program Modules : JavaScript programs can be organized into modules, which are
self-contained blocks of code that can be used across multiple scripts. Modules can be
imported and exported using the ES6 module syntax.
Syntax : var moduleName = (function() {
ㅤㅤㅤㅤㅤㅤ // private variables and functions
ㅤㅤㅤㅤㅤㅤ var privateVar = ...;
ㅤㅤㅤㅤㅤㅤ function privateFunction() {...}
ㅤㅤㅤㅤㅤㅤ// public variables and functions
ㅤㅤㅤㅤㅤㅤreturn {
ㅤㅤㅤㅤㅤㅤㅤㅤpublicVar: ...,
ㅤㅤㅤㅤㅤㅤㅤㅤpublicFunction: function() {...}
ㅤㅤㅤㅤㅤㅤ};
ㅤㅤㅤㅤ})();
Function Definitions : A function in JavaScript is defined using the function keyword
followed by the function name, a list of parameters (optional), and the function body
enclosed in curly braces.
Syntax : function functionName(param1, param2, ...) {
ㅤㅤㅤㅤㅤㅤ // function body
ㅤㅤㅤㅤ }
Duration of Identifiers : In JavaScript, the duration of an identifier is determined by its
scope. An identifier's scope is the region of the code where the identifier can be
accessed. There are two types of scope in JavaScript: global scope and local scope.
Global scope is the scope outside of any function, and local scope is the scope inside a
function.
Scope Rules : JavaScript has function-level scope, which means that variables declared
inside a function are only accessible inside that function (local scope). Variables
declared outside of any function are accessible from anywhere in the code (global
scope). However, it is generally considered good practice to avoid using global
variables as much as possible to prevent naming collisions and improve code
maintainability.
Controlling Programming Flow : JavaScript provides a variety of control structures
that can be used to control the flow of execution in a script. These include loops,
conditional statements, and error handling blocks like try/catch.
Break statement : break;
Continue statement : continue;
Recursion : It's a process in which a function calls itself as a subroutine. This technique
is useful in situations where a problem can be broken down into smaller subproblems
that can be solved recursively.
Syntax : function recursion(param1, param2, ... paramN) {
ㅤㅤㅤㅤㅤㅤ if (base case) {
ㅤㅤㅤㅤㅤㅤㅤㅤ return some value;
ㅤㅤㅤㅤㅤㅤ } else {
ㅤㅤㅤㅤㅤㅤㅤㅤ recursion(modified param1, modified param2, ... modified paramN);
ㅤㅤㅤㅤㅤㅤ }
ㅤㅤㅤㅤ }
JavaScript Global Functions : JavaScript has a number of built-in functions that can be
accessed from anywhere in a script. These functions are called global functions and
are not associated with any particular object.
Some examples of JavaScript global functions are :
ㅤ isNaN() : checks if a value is not a number.
ㅤ parseInt() : converts a string to an integer.
ㅤ parseFloat() : converts a string to a floating-point number.
ㅤ encodeURI() : encodes a URI.
ㅤ decodeURI() : decodes a URI.
ㅤ setTimeout() : sets a delay in milliseconds before executing a function.
ㅤ setInterval() : repeatedly executes a function at a set interval in milliseconds.
Syntax : function myFunction() {
ㅤㅤㅤㅤㅤㅤ var x = 5;
ㅤㅤㅤㅤㅤㅤ var y = isNaN(x);
ㅤㅤㅤㅤ }
Javascript array
Introduction : An array is a variable that can hold more than one value at a time.
Arrays in JavaScript can hold values of different data types, including strings, numbers,
and objects.
Array declaring :
Syntax : var arrayName = [];ㅤㅤㅤㅤorㅤㅤㅤㅤvar arrayName = new Array();
Allocating memory :
Syntax : arrayName.length = size;
Passing arrays to functions :
Syntax : function functionName(arrayName) {
ㅤㅤㅤㅤㅤㅤ // function code
ㅤㅤㅤㅤ }
Multiple subscripted arrays : JavaScript supports multiple-subscripted arrays, also
known as multidimensional arrays.
Syntax : var arrayName = [[], [], []];
The JavaScript Object Model : The JavaScript Object Model (DOM) is a programming
interface for web documents. It represents the page so that programs can change the
document structure, style, and content.
JavaScript language Objects : JavaScript has several built-in objects that provide various
functionalities, such as Date, Math, and String.
Syntax : var objectName = new Object(); ㅤㅤㅤㅤ ㅤㅤㅤㅤ
or var objectName = {};
Developing Interactive Forms : JavaScript can be used to add interactivity to web
forms. You can manipulate form elements such as textboxes, radio buttons, and
checkboxes using JavaScript.
Validation of Forms : JavaScript can also be used for form validation, where you can
check if the input entered by the user is valid or not.
Cookies and JavaScript Security : Cookies are small pieces of data that are stored on
the client's computer by the web server. JavaScript can be used to create, read, and
delete cookies. However, they can also be used for malicious purposes, so it is
important to ensure proper security measures are in place.
Controlling Frames in JavaScript : JavaScript can be used to control frames in a web
page. You can change the content of a frame, navigate between frames, and open new
windows.
Client-Side JavaScript Custom : Custom client-side JavaScript can be used to add
functionality to a web page. It can be used to create animations, validate forms, and
perform other tasks.
JavaScript Objects: JavaScript objects are collections of key-value pairs.
Syntax : var objectName = {key1: value1, key2: value2, ...};
You can access object properties using the dot notation or square bracket notation:
Syntax : objectName.keyName; ㅤㅤㅤㅤ ㅤㅤㅤㅤor objectName['keyName'];