SlideShare a Scribd company logo
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
BCA IV
WEB TECHNOLOGIES
Paper Code 204
HTML
HTML stands for Hypertext Markup Language It’s a markup language
used to structure text and multimedia documents and to set up hypertext
links between documents, used extensively on the World Wide Web.
HTML was invented in 1990 by a scientist called Tim Berners-Lee
Different versions of HTML:-
• HTML 2.0(1995)
• HTML 3.2(1997)
• HTML 4.0(1998)
• HTML 4.0.1(1999)
• HTML 5 (2008)
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
What is needed?
• A web browser- Microsoft IE, Google Chrome,
Mozilla Firefox etc.
• A Text Editor- Notepad(Microsoft Windows) or
TextEdit(MAC.)
HTML file extension - .htm or .html
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
Basic structure of an HTML
document
<html>
<head>
<title>Page Title</title>
</head>
<body>
The main part of the document goes here.
</body>
</html>
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
Comment Tag
<!-- comments here -->
 text within this tag will not be displayed or processed by your
browser
 comments may be one or multiple lines long (HTML is free-form)
 comments do not nest! No comments inside comments!
Attributes
Tags can also have attributes, which are extra bits of information.
Attributes appear inside the opening tag and their values sit inside
quotation marks. They look something like <tag
attribute="value">Margarine</tag>
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
Rules regarding attributes:
• Any attributes in an HTML tag need to appear
after the HTML tag name.
• The attribute name must be followed
immediately by an equal sign (=).
• The attribute value needs to come immediately
after the equal sign.
• The attribute value must always be enclosed in
quotes, either single or double.
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
Meta tag
• Meta tags contain information about the page
that does not need to be displayed, but it still
used by search engines and other web
crawlers. They are typically used to give search
engines a brief description of the page, as well
as the important keywords on it. Meta tags
must appear within the head section of the
html, and have usually have two of the
following attributes:
• name="?" - The name of the meta tag, such
as description, keywords or author.
• .
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
Examples
• <meta name="Author" content="Jhon Doe" />
• <meta name="keywords" lang="en" content="car, rental, rent" />
• <meta name="keywords" lang="es" content="autos, alquiler, alquila" />
• <meta name="description" lang="en" content="Car rental in New York." />
• <meta http-equiv="expires" content="Mon, 20 Sep 2006 11:09:00 GMT" />
• <meta http-equiv="pragma" content="no-cache" />
• <meta http-equiv="refresh" content="3; URL=http://www.google.com" />
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
HTML <body> Tag
• Attributes
Example:-
<body alink="red" vlink="maroon" link="blue" text="black"
bgcolor="white" background="title.jpg">
Attributes value
background url
bgcolor color
text color
link color
vlink color
alink color
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
Text Formatting Tags
• Header - <h?> </h?>There are 6 levels of headings available,
from h1 for the largest and most important heading, down to h6 for
the smallest heading.
• Bold - <b> </b>The text in between the tags will be bold, and stand
out against text around it, the same as in a word processor.
• Italic - <i> </i>Also working the same way as a word processor,
italics displays the text at a slight angle.
• Underline - <u> </u>Again, the same as underline in a word
processor. Note that html links are already underlined and don't
need the extra tag.
• Strike-out - <strike> </strike>Puts a line right through the centre of
the text, crossing it out. Often used to show that text is old and no
longer relevant. Also works by using <s> </s> instead.
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
• Preformatted Text - <pre> </pre>Any text between the pre tags,
including spaces, carriage returns and punctuation, will appear in
the browser as it would in a text editor (normally browsers ignore
multiple spaces)
• Source Code - <code> </code>Similar to tt the text is displayed in a
fixed-width font, and is commonly used to show source code. I have
used it on this site, along with stylesheets, to show all tags.
• Typewriter Text - <tt> </tt>The text appears to have been typed by
a typewriter, in a fixed-width font. For example: This text is written
using the <tt></tt> tags.
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
• Small - <small> </small>Instead of having to set a font size, you can
use the small tag to render text slightly smaller than the text around
it. Useful for displaying the 'fine-print'.
• Font Colour - <font color="#??????"> </font>Change the colour of
a few words or a section of text.
• Font Size - <font size="?"> </font>Replace the ? with a number
from 1 to 7 to change the size of the font. One being the smallest
and seven the largest.
• Font Size Change - <font size="+/-?"> </font>For an immediate
change of font size with respect to the font size preceding it, this tag
increase or decreases the size of the font by the number you
specify. Eg: <font size="-1">Some Text</font>
• Change Font Face - <font face="?"> </font>To show text in a
particular font, use the font name such "Helvetica" or "Arial" or
"Courier". Be aware that using some fancy font from your computer
means that the person viewing that page must also have that font
installed on their computer too, otherwise it will look totally different
to them.
• Centre - <center> </center>A useful tag, as it says, it makes
everything in between the tags centered (in the middle of the page).
• Emphasis - <em> </em>Used to emphasize text, which usually
appears in italics, but can vary according to your browser.
• Strong Emphasis - <strong> </strong>Used to emphasize text
more, which usually appears in bold, but can vary according to your
browser.
Special HTML Characters
• Tag Start - &lt; - <
Less-Than symbol, usually used to define the start of an actual
HTML tag.
• Tag End - &gt; - >
Greater-Than symbol, used to declare the end of each tag.
• Quotation Marks - &quot; - “
As the name says: to mark a quote, or in html terms: to
declare the value of a tag attribute.
• Ampersand - &amp; - &
It is used to define the start of all special character tags, so it
needs a special charachter tag itself.
• Non Breaking Space - &nbsp;
A space, a plain ordinary space (like when you press
the spacebar). The non-breaking part is relevant
because multiple spaces in HTML will only show
up as one space on your web page. This tag can
be used many times in a row to force the web
browser to display many spaces on the web page.
• Copyright - &copy; - ©
Copyright indicates ownership of intellectual property.
• Trademark - &trade; - ™
Declares a product name or images as
business trademark that is not yet registered.
• Registered - &reg; - ®
Used to indicate that a product or business trademark
that is officially registered.
• One Half - &frac12; - ½
Fraction symbol for One Half (0.5) of some other
value.
• Degree - &deg; - °
The degree symbol is used to represent temperature
or angular measurements.
HTML Linking Tags
• Basic Link - <a href="url">link text</a>There are two main parts to a link tag: the
text a user can click, and the web address they go to if they click it. The bit
between the <a> and </a> tags is the link text, and is generally displayed in blue
and underlined by web browsers. The href="url" part is the web address,
where url can be set in several ways:
href="example.html" - another page in the current
• Link to a Fragment - <a href="#fragment">link</a>It is often usefull to link to
other places on the same webpage, such as other sections or chapters further
down the page. The technical term for this is linking to a Fragment, where
browsers will automatically try and scroll to that part of the page. Fragments first
need to be defined somewhere in a webpage by giving them a name, for
example <a name="fragment_name">, then links to this fragment are created by
using the hash (#) character:<a href="#fragment_name">Link</a>. To link to a
fragment on another page you would simply append the fragment name to the
address, for example: href="example.html#fragment_name".
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
• Target Window - <a href="url" target="???">link</a>You may not always
want to link to a page and have it load up over the one you are currently
viewing. Thats where the target attribute comes in handy. By setting
the target="_BLANK" the page you link to will load up in a new window (or
new tab in some newer browsers). Similary,"_self", "_parent", or "_top" will
open the link in the current window, the parent window.
• Image as a Link - <a href="url"><img ...></a>By placing an image
tag between the <a> and </a> tags, you can turn an image into a link, and
clicking on that image will then load the referenced page. You may notice
that the image gets a blue border just as link text became underlined. This
can be resolved by setting the border="0"attribute of the image, or
using css.
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
• Email Link - <a href="mailto:email"></a>A special kind of
link, the mailto notation link instructs the browser to compose
and email to the specified address using the default email
program. It but does not actually send any emails
automatically. You can also set a subject for the email by
using
<a href="mailto:pramod.pandey@jagannath.org?Subject=Linking">email
me</a>
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
 <img> (no closing tag needed)
 used to display graphics (.jpeg, .png, .gif) in your web pages
 you must specify the URL for the image source, and an alt= text
 the basic attributes of <img> are:
 src=”string” - the absolute or relative location of the image file
 alt=”string” - Alternate Text for people who don't see images
 height=”string” - image height, percent or absolute pixels (optional)
 width=”string” - image width, percent or absolute pixels (optional)
 title=”string” - mouse-over title of the image (optional)
Image tag
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
INTRODUCTION TO
JAVASCRIPT
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
JAVASCRIPT
JavaScript is used in millions of Web pages to improve the
design, validate forms, detect browsers, create cookies, and
much more.
JavaScript is the most popular scripting language on the
internet, and works in all major browsers, such as Internet
Explorer, Mozilla, Firefox, Netscape, Opera.
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
WHAT IS JAVASCRIPT?
JavaScript was designed to add interactivity to HTML
pages
JavaScript is a scripting language (a scripting
language is a lightweight programming language)
A JavaScript consists of lines of executable computer
code
A JavaScript is usually embedded directly into HTML
pages
JavaScript is an interpreted language (means that
scripts execute without preliminary compilation)
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
Are Java and JavaScript the Same?
Java and JavaScript are two completely different languages in
both concept and design!
Java (developed by Sun Microsystems) is a powerful and
much more complex programming language - in the same
category as C and C++.
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
How to Put a JavaScript Into an HTML
Page?
<html>
<body>
<script type="text/javascript">
document.write("Hello World!")
</script>
</body>
</html>
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
Ending Statements With a
Semicolon?With traditional programming languages, like C++ and Java,
each code statement has to end with a semicolon (;).
Many programmers continue this habit when writing
JavaScript, but in general, semicolons are optional!
However, semicolons are required if you want to put more
than one statement on a single line.
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
JavaScript Variables
Variables are used to store data.
A variable is a "container" for information you want to
store. A variable's value can change during the
script. You can refer to a variable by name to see
its value or to change its value.
Rules for variable names:
Variable names are case sensitive
They must begin with a letter or the underscore character
strname – STRNAME (not same)
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
JavaScript Operators
Operator Description Example Result
+ Addition x=2 4
y=2
x+y
- Subtraction x=5 3
y=2
x-y
* Multiplication x=5 20
y=4
x*y
/ Division 15/5 3
5/2 2,5
% Modulus (division remainder) 5%2 1
10%8 2
10%2 0
++ Increment x=5 x=6
x++
-- Decrement x=5 x=4
x--
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
JavaScript Operators – 2
Assignment Operators
(
Operator Example Is The Same As
= x=y x=y
+= x+=y x=x+y
-= x-=y x=x-y
*= x*=y x=x*y
/= x/=y x=x/y
%= x%=y x=x%y
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
JavaScript Operators - 3
Comparison Operators
Operator Description Example
== is equal to 5==8 returns false
=== is equal to (checks for both value and type) x=5
y="5"
x==y returns true
x===y returns false
!= is not equal 5!=8 returns true
> is greater than 5>8 returns false
< is less than 5<8 returns true
>= is greater than or equal to 5>=8 returns false
<= is less than or equal to 5<=8 returns true
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
JavaScript Operators - 4
Logical Operators
Operator Description Example
&& and x=6
y=3
(x < 10 && y > 1) returns true
|| or x=6
y=3
(x==5 || y==5) returns false
! not x=6
y=3
!(x==y) returns true
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
JavaScript Basic Examples
<script>
document.write("Hello World!")
</script>  format text with HTML code - heading
<script>
alert("Hello World!")
</script>
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
Example
<script>
x=“Hello World!”
document.write(x)
</script>
<script>
x=“İsminizi Yazın….”
document.write(“Merhaba” +x)
</script>  use line break html code
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
JavaScript Popup Boxes
Alert Box
An alert box is often used if you want to make sure
information comes through to the user.
When an alert box pops up, the user will have to click "OK"
to proceed.
<script>
alert("Hello World!")
</script>
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
JavaScript Popup Boxes - 2
Confirm Box
A confirm box is often used if you want the user to verify or
accept something.
When a confirm box pops up, the user will have to click
either "OK" or "Cancel" to proceed.
If the user clicks "OK", the box returns true. If the user
clicks "Cancel", the box returns false.
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
JavaScript Popup Boxes - 3
Prompt Box
A prompt box is often used if you want the user to input a
value before entering a page.
When a prompt box pops up, the user will have to click
either "OK" or "Cancel" to proceed after entering an input
value.
If the user clicks "OK“, the box returns the input value. If
the user clicks "Cancel“, the box returns null.
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
Prompt Box Example
<script>
x=prompt (“Adınızı Yazınız”, “ ”)
document.write(“Merhaba <br>”,+x)
</script>
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
Examples -2
<script>
s1=12
s2=28
toplam=s1+s2
document.write("Sayıların toplamı: "+toplam)
</script>
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
Conditional Statements
Very often when you write code, you want to perform different actions for
different decisions. You can use conditional statements in your code to
do this.
In JavaScript we have the following conditional statements:
if statement - use this statement if you want to execute some code only if a
specified condition is true
if...else statement - use this statement if you want to execute some code if
the condition is true and another code if the condition is false
if...else if....else statement - use this statement if you want to select one of
many blocks of code to be executed
switch statement - use this statement if you want to select one of many
blocks of code to be executed
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
What is DHTML?
DHTML is the combination of several built-in browser features in
fourth generation browsers that enable a web page to be more
dynamic.
DHTML is NOT a scripting language (like JavaScript or VBscript), but
a browser feature- or enhancement- that makes the browser dynamic
It uses a host of different technologies - JavaScript, VBScript, the
Document Object Model (DOM), layers, cascading stylesheets - to
create HTML that can change even after a page has been loaded into
a browser
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
What is DHTML?
It is considered to be made up of
–HTML
–Cascading Style Sheets (CSS)
–Scripting language
All three of these components are linked via Document Object Model
(DOM)
DOM is the interface that allows scripting languages to access the
content, style, and structure of the web documents and change them
dynamically
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
Tools of DTHML
HTML and XML
–Partitions and Organizes the content
CSS
–Defines the Presentation of the content
Scripting - JavaScript, JScript, VBScript
–Adds interactivity to the page
DOM- Document Object Model
–Defines what and how elements are exposed for script access
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
Components of DHTML
DHTML requires four independent components to work: HTML, Cascading Style
Sheets, Scripting and the Document Object Model. The section provides a
brief description of each component.
1. HTML:
HTML defines the structure of a Web page, using such basic elements as
headings, forms, tables, paragraphs and links. On December 18, 1997,
HTML 4.0 attained "recommended" status at the W3C. Changes and
enhancements introduced in HTML 4.0 made DHTML possible.
2. Cascading Style Sheets (CSS): Similar to a template in a word-
processing document, a style sheet controls the formatting of HTML
elements. Like in traditional desktop publishing, one can use style sheet
to specify page margins, point sizes and leading. Cascading Style
Sheets is a method to determine precedence and to resolve conflicts
when multiple styles are used.
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
3. Scripting:
Scripting provides the mechanisms to interpret user actions and produce
client-side changes to a page. For example, scripts can interpret mouse
actions (such as the mouse passing over a specified area of a page
through the event model) and respond to the action by using a set of
predefined instructions (such as highlighting the text activated by the
mouse action). Although DHTML can communicate with several scripting
languages, JavaScript is the de facto standard for creating cross-browser
DHTML pages.
4. Document Object Model (DOM):
The DOM outlines Web page content in a way that makes it possible for
HTML elements, style sheets and scripting languages to interact with
each other. The W3C defines the DOM as "a platform- and language-
neutral interface that will allow programs and scripts to dynamically
access and update the content, structure, and style of documents. The
document can be further processed and the results of that processing
can be incorporated back into the presented stage."
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
DOM – Document Object Model
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
DOM Introduction
Dynamic HTML object model
“The Document Object Model (DOM) is an application
programming interface (API) for HTML and XML
documents. It defines the logical structure of
documents and the way a document is accessed and
manipulated.”
Great control over presentation of pages
Access to all elements on the page
Whole web page (elements, forms, frames, tables, etc.)
represented in an object hierarchy
“Anything found in an HTML or XML document can be
accessed, changed, deleted, or added using the
Document Object Model, with a few exceptions.”
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
DOM Introduction – cont’d
HTML elements treated as objects
Attributes of these elements treated as properties of those
objects
Objects identified with an ID attribute can be scripted with
languages like JavaScript and VBScript.
Elements on the page can be supported by scripting that can
interact with user events and change the page content
dynamically.
The DOM dictates how the written scripting language controls the
elements on the screen, such as graphics and text.
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
DOM-Document Object Model …
The Document Object Model is a platform- and language-neutral
interface that will allow programs and scripts to dynamically access and
update the content, structure and style of the document
The DOM details the characteristic properties of each element of a
Web page, thereby detailing how we might manipulate these
components and, in turn, manipulate the page
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
Document Object Model is not a "part" of Scripting languages. The
DOM stands alone, able to be interfaced with any programming
language designed to do so
The W3C DOM is the recommended standard to be exposed by
each browser
Microsoft Internet Explorer and Netscape do not share the same
DOM.
DOM-Document Object Model…
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
 Both (IE and Netscape) DOMs break down Web pages into roughly
four types of components
–Objects, Properties, Events and Methods
Objects :
–Container which reflects a particular element of a page
–objects "contain" the properties and methods which apply to that
element
DOM-Document Object Model…
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
 Properties:
–Characteristics of an object
–Example: the ‘document’ object possesses a ‘bgColor’ property
which reflects the background color of the page.
–Using a programming language (e.g. JavaScript) you may, via
this property, read or modify the background color of a page
DOM-Document Object Model…
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
Methods:
–A method typically executes an action which acts upon the object by
which it is owned
Events:
–Used to trap actions related to its owning object
–Typically, these actions are caused by the user
DOM-Document Object Model…
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
DOM
• DOM = Document Object Model
Defines a hierarchical model of the document structure
through which all document elements may be accessed
• Nodes
The W3C DOM defines element of a document is a node
of a particular type
Node Types
Common types are: document node, element node, text
node, attribute node, comment node, document-type node
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
DOM Example
document node
Document_type node
<!DOCTYPE>
element node
<HTML>
element node
<HEAD>
element node
<TITLE>
text node
"Sample"
element node
<BODY>
element node
<P>
text node
"This is a..."
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
Netscape DOM
DOM "begins" at the window object;
Other objects are below the window object in the hierarchy
Exception is the navigator object, (whose properties provide
information about the browser version,) which is a peer object of
window rather than a child
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
Microsoft DOM
Microsoft indexes an additional topic called as collections. A
"collection," is an array-based object
The observable difference between the two is the syntax. Netscape
supports a treelike hierarchical syntax
On the other hand, Internet Explorer exposes all HTML objects as a
flat collection and lets you modify the style object
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
window
document
history
navigator
applets
all
anchors
body
embeds
forms
filters
images
links
plugins
styleSheets
scripts
location
screen
event
document
document
plugins
object
collection
Key
frames
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
15.3 Collections all and children
Collections are basically arrays of related objects on a
page
all
Collection of all the HTML elements in a document in the order
in which they appear
length property
Specifies the number of elements in the collection
tagName property of an element
Determines the name of the element
Every element has its own all collection, consisting of
all the elements contained within that elementChanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
Advantage
Robust API for DOM tree
Relatively simple to modify data structure and
extract data
Disadvantage Store entire document in memoryAs
DOM was written for any language method naming
not follow the standard VB programming conventions
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
What is XML
XML stands for eXtensible Markup Language.
A markup language is used to provide information
about a document.
Tags are added to the document to provide the extra
information.
HTML tags tell a browser how to display the
document.
XML tags give a reader some idea what some of the
data means.
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
What is XML Used For?
XML documents are used to transfer data from one place to
another often over the Internet.
XML subsets are designed for particular applications.
One is RSS (Rich Site Summary or Really Simple Syndication
). It is used to send breaking news bulletins from one web
site to another.
A number of fields have their own subsets. These include
chemistry, mathematics, and books publishing.
Most of these subsets are registered with the W3Consortium
and are available for anyone’s use.
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
Advantages of XML
XML is text (Unicode) based.
Takes up less space.
Can be transmitted efficiently.
One XML document can be displayed differently in
different media.
Html, video, CD, DVD,
You only have to change the XML document in order to
change all the rest.
XML documents can be modularized. Parts can be
reused.
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
Example of an HTML Document
<html>
<head><title>Example</title></head.
<body>
<h1>This is an example of a page.</h1>
<h2>Some information goes here.</h2>
</body>
</html>
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
Example of an XML Document
<?xml version=“1.0”/>
<address>
<name>Alice Lee</name>
<email>alee@aol.com</email>
<phone>212-346-1234</phone>
<birthday>1985-03-22</birthday>
</address>
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
Difference Between HTML and XML
HTML tags have a fixed meaning and browsers know what it
is.
XML tags are different for different applications, and users
know what they mean.
HTML tags are used for display.
XML tags are used to describe documents and data.
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
XML Rules
Tags are enclosed in angle brackets.
Tags come in pairs with start-tags and end-tags.
Tags must be properly nested.
<name><email>…</name></email> is not allowed.
<name><email>…</email><name> is.
Tags that do not have end-tags must be terminated by a ‘/’.
<br /> is an html example.
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
More XML Rules
Tags are case sensitive.
<address> is not the same as <Address>
XML in any combination of cases is not allowed as
part of a tag.
Tags may not contain ‘<‘ or ‘&’.
Tags follow Java naming conventions, except that a
single colon and other characters are allowed.
They must begin with a letter and may not contain
white space.
Documents must have a single root tag that begins
the document.
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
Encoding
XML (like Java) uses Unicode to encode characters.
Unicode comes in many flavors. The most common one
used in the West is UTF-8.
UTF-8 is a variable length code. Characters are encoded
in 1 byte, 2 bytes, or 4 bytes.
The first 128 characters in Unicode are ASCII.
In UTF-8, the numbers between 128 and 255 code for
some of the more common characters used in western
Europe, such as ã, á, å, or ç.
Two byte codes are used for some characters not listed in
the first 256 and some Asian ideographs.
Four byte codes can handle any ideographs that are left.
Those using non-western languages should investigate
other versions of Unicode.
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
Well-Formed Documents
An XML document is said to be well-formed if it
follows all the rules.
An XML parser is used to check that all the rules
have been obeyed.
Recent browsers such as Internet Explorer 5 and
Netscape 7 come with XML parsers.
Parsers are also available for free download over the
Internet. One is Xerces, from the Apache open-
source project.
Java 1.4 also supports an open-source parser.
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
XML Example Revisited
<?xml version=“1.0”/>
<address>
<name>Alice Lee</name>
<email>alee@aol.com</email>
<phone>212-346-1234</phone>
<birthday>1985-03-22</birthday>
</address>
Markup for the data aids understanding of its purpose.
A flat text file is not nearly so clear.
Alice Lee
alee@aol.com
212-346-1234
1985-03-22
The last line looks like a date, but what is it for?Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
Expanded Example
<?xml version = “1.0” ?>
<address>
<name>
<first>Alice</first>
<last>Lee</last>
</name>
<email>alee@aol.com</email>
<phone>123-45-6789</phone>
<birthday>
<year>1983</year>
<month>07</month>
<day>15</day>
</birthday>
</address>
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
XML Files are Trees
address
name email phone birthday
first last year month day
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
XML Trees
An XML document has a single root node.
The tree is a general ordered tree.
A parent node may have any number of children.
Child nodes are ordered, and may have siblings.
Preorder traversals are usually used for getting information out
of the tree.
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
Validity
A well-formed document has a tree structure and
obeys all the XML rules.
A particular application may add more rules in either
a DTD (document type definition) or in a schema.
Many specialized DTDs and schemas have been
created to describe particular areas.
These range from disseminating news bulletins
(RSS) to chemical formulas.
DTDs were developed first, so they are not as
comprehensive as schema.
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
Document Type Definitions
A DTD describes the tree structure of a document and
something about its data.
There are two data types, PCDATA and CDATA.
PCDATA is parsed character data.
CDATA is character data, not usually parsed.
A DTD determines how many times a node may appear, and
how child nodes are ordered.
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
DTD for address Example
<!ELEMENT address (name, email, phone, birthday)>
<!ELEMENT name (first, last)>
<!ELEMENT first (#PCDATA)>
<!ELEMENT last (#PCDATA)>
<!ELEMENT email (#PCDATA)>
<!ELEMENT phone (#PCDATA)>
<!ELEMENT birthday (year, month, day)>
<!ELEMENT year (#PCDATA)>
<!ELEMENT month (#PCDATA)>
<!ELEMENT day (#PCDATA)>
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
Schemas
Schemas are themselves XML documents.
They were standardized after DTDs and provide
more information about the document.
They have a number of data types including string,
decimal, integer, boolean, date, and time.
They divide elements into simple and complex types.
They also determine the tree structure and how many
children a node may have.
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
Schema for First address Example
<?xml version="1.0" encoding="ISO-8859-1" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="address">
<xs:complexType>
<xs:sequence>
<xs:element name="name" type="xs:string"/>
<xs:element name="email" type="xs:string"/>
<xs:element name="phone" type="xs:string"/>
<xs:element name="birthday" type="xs:date"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
Explanation of Example Schema
<?xml version="1.0" encoding="ISO-8859-1" ?>
ISO-8859-1, Latin-1, is the same as UTF-8 in the first 128 characters.
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
www.w3.org/2001/XMLSchema contains the schema standards.
<xs:element name="address">
<xs:complexType>
This states that address is a complex type element.
<xs:sequence>
This states that the following elements form a sequence and must come
in the order shown.
<xs:element name="name" type="xs:string"/>
This says that the element, name, must be a string.
<xs:element name="birthday" type="xs:date"/>
This states that the element, birthday, is a date. Dates are always of the
form yyyy-mm-dd.
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
XSLT
Extensible Stylesheet Language Transformations
XSLT is used to transform one xml document into
another, often an html document.
The Transform classes are now part of Java 1.4.
A program is used that takes as input one xml
document and produces as output another.
If the resulting document is in html, it can be viewed
by a web browser.
This is a good way to display xml data.
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
A Style Sheet to Transform address.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="address">
<html><head><title>Address Book</title></head>
<body>
<xsl:value-of select="name"/>
<br/><xsl:value-of select="email"/>
<br/><xsl:value-of select="phone"/>
<br/><xsl:value-of select="birthday"/>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
Parsers
There are two principal models for parsers.
SAX – Simple API for XML
Uses a call-back method
Similar to javax listeners
DOM – Document Object Model
Creates a parse tree
Requires a tree traversal
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)

More Related Content

What's hot

HTML and XML Difference FAQs
HTML and XML Difference FAQsHTML and XML Difference FAQs
HTML and XML Difference FAQs
Umar Ali
 
Basic concept of internet
Basic concept of internetBasic concept of internet
Basic concept of internet
Snehal Shahane
 
Xml
XmlXml
Cascading Style Sheet (CSS)
Cascading Style Sheet (CSS)Cascading Style Sheet (CSS)
Cascading Style Sheet (CSS)
AakankshaR
 
PPT on Basic HTML Tags
PPT on Basic HTML TagsPPT on Basic HTML Tags
PPT on Basic HTML Tags
VinitaPaliwal1
 
Network topology
Network topologyNetwork topology
Network topology
Shubham Agrawal
 
Java package
Java packageJava package
Java package
CS_GDRCST
 
String in java
String in javaString in java
javascript objects
javascript objectsjavascript objects
javascript objects
Vijay Kalyan
 
constructors in java ppt
constructors in java pptconstructors in java ppt
constructors in java ppt
kunal kishore
 
Normal forms
Normal formsNormal forms
Normal forms
Samuel Igbanogu
 
JavaScript Objects
JavaScript ObjectsJavaScript Objects
JavaScript Objects
Reem Alattas
 
Java loops for, while and do...while
Java loops   for, while and do...whileJava loops   for, while and do...while
Java loops for, while and do...while
Jayfee Ramos
 
Network topology.ppt
Network topology.pptNetwork topology.ppt
Network topology.ppt
Siddique Ibrahim
 
Computing Environment
Computing EnvironmentComputing Environment
Computing Environment
kem warren
 
System calls
System callsSystem calls
System calls
Bernard Senam
 
Learn html Basics
Learn html BasicsLearn html Basics
Learn html Basics
McSoftsis
 

What's hot (20)

HTML and XML Difference FAQs
HTML and XML Difference FAQsHTML and XML Difference FAQs
HTML and XML Difference FAQs
 
Basic concept of internet
Basic concept of internetBasic concept of internet
Basic concept of internet
 
Xml
XmlXml
Xml
 
Cascading Style Sheet (CSS)
Cascading Style Sheet (CSS)Cascading Style Sheet (CSS)
Cascading Style Sheet (CSS)
 
PPT on Basic HTML Tags
PPT on Basic HTML TagsPPT on Basic HTML Tags
PPT on Basic HTML Tags
 
Network topology
Network topologyNetwork topology
Network topology
 
Html Ppt
Html PptHtml Ppt
Html Ppt
 
Java package
Java packageJava package
Java package
 
String in java
String in javaString in java
String in java
 
javascript objects
javascript objectsjavascript objects
javascript objects
 
Osi model
Osi modelOsi model
Osi model
 
constructors in java ppt
constructors in java pptconstructors in java ppt
constructors in java ppt
 
Normal forms
Normal formsNormal forms
Normal forms
 
JavaScript Objects
JavaScript ObjectsJavaScript Objects
JavaScript Objects
 
Java loops for, while and do...while
Java loops   for, while and do...whileJava loops   for, while and do...while
Java loops for, while and do...while
 
Network topology.ppt
Network topology.pptNetwork topology.ppt
Network topology.ppt
 
Operators in PHP
Operators in PHPOperators in PHP
Operators in PHP
 
Computing Environment
Computing EnvironmentComputing Environment
Computing Environment
 
System calls
System callsSystem calls
System calls
 
Learn html Basics
Learn html BasicsLearn html Basics
Learn html Basics
 

Similar to Web Technologies

HTML
HTMLHTML
HTML_JavaScript_Malaysia_2008 (2).ppt
HTML_JavaScript_Malaysia_2008 (2).pptHTML_JavaScript_Malaysia_2008 (2).ppt
HTML_JavaScript_Malaysia_2008 (2).ppt
Dianajeon3
 
Web Concepts - an introduction - introduction
Web Concepts - an introduction - introductionWeb Concepts - an introduction - introduction
Web Concepts - an introduction - introduction
clement swarnappa
 
Introduction to Web Development.pptx
Introduction to Web Development.pptxIntroduction to Web Development.pptx
Introduction to Web Development.pptx
Alisha Kamat
 
Introduction to Web Development.pptx
Introduction to Web Development.pptxIntroduction to Web Development.pptx
Introduction to Web Development.pptx
GDSCVJTI
 
Introduction to Web Development.pptx
Introduction to Web Development.pptxIntroduction to Web Development.pptx
Introduction to Web Development.pptx
Alisha Kamat
 
HTML element is everything between the start tag and the end tag
HTML element is everything between the start tag and the end tagHTML element is everything between the start tag and the end tag
HTML element is everything between the start tag and the end tag
ssuser6478a8
 
Training HTML5 CSS3 Ilkom IPB
Training HTML5 CSS3 Ilkom IPBTraining HTML5 CSS3 Ilkom IPB
Training HTML5 CSS3 Ilkom IPB
Wahyu Putra
 
Html
HtmlHtml
Html.pptx
Html.pptxHtml.pptx
Html.pptx
SuhaibKhan62
 
www.sparkdigital.co.in_Complete - Search Engine Optimization Guide_2023.pptx
www.sparkdigital.co.in_Complete - Search Engine Optimization Guide_2023.pptxwww.sparkdigital.co.in_Complete - Search Engine Optimization Guide_2023.pptx
www.sparkdigital.co.in_Complete - Search Engine Optimization Guide_2023.pptx
DineshSparkdigital
 
HTML- Hyper Text Markup Language
HTML- Hyper Text Markup LanguageHTML- Hyper Text Markup Language
HTML- Hyper Text Markup Language
Trinity Dwarka
 
Intro to html revised2
Intro to html revised2Intro to html revised2
Intro to html revised2
mmvidanes29
 
Lecture 2 introduction to html basics
Lecture 2 introduction to html basicsLecture 2 introduction to html basics
Lecture 2 introduction to html basics
AliMUSSA3
 
Web development intership Presentation.pptx
Web development intership Presentation.pptxWeb development intership Presentation.pptx
Web development intership Presentation.pptx
bodepallivamsi1122
 
HTML practical file
HTML practical fileHTML practical file
HTML practical file
Kuldeep Sharma
 
Web forms and html (lect 1)
Web forms and html (lect 1)Web forms and html (lect 1)
Web forms and html (lect 1)
Salman Memon
 
HTML introduction for beginners Slides .pptx
HTML introduction for beginners Slides .pptxHTML introduction for beginners Slides .pptx
HTML introduction for beginners Slides .pptx
wewit44414
 

Similar to Web Technologies (20)

HTML
HTMLHTML
HTML
 
Html presentation
Html presentationHtml presentation
Html presentation
 
HTML_JavaScript_Malaysia_2008 (2).ppt
HTML_JavaScript_Malaysia_2008 (2).pptHTML_JavaScript_Malaysia_2008 (2).ppt
HTML_JavaScript_Malaysia_2008 (2).ppt
 
Web Concepts - an introduction - introduction
Web Concepts - an introduction - introductionWeb Concepts - an introduction - introduction
Web Concepts - an introduction - introduction
 
Introduction to Web Development.pptx
Introduction to Web Development.pptxIntroduction to Web Development.pptx
Introduction to Web Development.pptx
 
Introduction to Web Development.pptx
Introduction to Web Development.pptxIntroduction to Web Development.pptx
Introduction to Web Development.pptx
 
Introduction to Web Development.pptx
Introduction to Web Development.pptxIntroduction to Web Development.pptx
Introduction to Web Development.pptx
 
HTML element is everything between the start tag and the end tag
HTML element is everything between the start tag and the end tagHTML element is everything between the start tag and the end tag
HTML element is everything between the start tag and the end tag
 
Training HTML5 CSS3 Ilkom IPB
Training HTML5 CSS3 Ilkom IPBTraining HTML5 CSS3 Ilkom IPB
Training HTML5 CSS3 Ilkom IPB
 
Html
HtmlHtml
Html
 
Html.pptx
Html.pptxHtml.pptx
Html.pptx
 
www.sparkdigital.co.in_Complete - Search Engine Optimization Guide_2023.pptx
www.sparkdigital.co.in_Complete - Search Engine Optimization Guide_2023.pptxwww.sparkdigital.co.in_Complete - Search Engine Optimization Guide_2023.pptx
www.sparkdigital.co.in_Complete - Search Engine Optimization Guide_2023.pptx
 
HTML- Hyper Text Markup Language
HTML- Hyper Text Markup LanguageHTML- Hyper Text Markup Language
HTML- Hyper Text Markup Language
 
Intro to html revised2
Intro to html revised2Intro to html revised2
Intro to html revised2
 
Lecture 2 introduction to html basics
Lecture 2 introduction to html basicsLecture 2 introduction to html basics
Lecture 2 introduction to html basics
 
Web development intership Presentation.pptx
Web development intership Presentation.pptxWeb development intership Presentation.pptx
Web development intership Presentation.pptx
 
Html
HtmlHtml
Html
 
HTML practical file
HTML practical fileHTML practical file
HTML practical file
 
Web forms and html (lect 1)
Web forms and html (lect 1)Web forms and html (lect 1)
Web forms and html (lect 1)
 
HTML introduction for beginners Slides .pptx
HTML introduction for beginners Slides .pptxHTML introduction for beginners Slides .pptx
HTML introduction for beginners Slides .pptx
 

More from cpjcollege

Tax Law (LLB-403)
Tax Law (LLB-403)Tax Law (LLB-403)
Tax Law (LLB-403)
cpjcollege
 
Law and Emerging Technology (LLB -405)
 Law and Emerging Technology (LLB -405) Law and Emerging Technology (LLB -405)
Law and Emerging Technology (LLB -405)
cpjcollege
 
Law of Crimes-I ( LLB -205)
 Law of Crimes-I  ( LLB -205)  Law of Crimes-I  ( LLB -205)
Law of Crimes-I ( LLB -205)
cpjcollege
 
Socio-Legal Dimensions of Gender (LLB-507 & 509 )
Socio-Legal Dimensions of Gender (LLB-507 & 509 )Socio-Legal Dimensions of Gender (LLB-507 & 509 )
Socio-Legal Dimensions of Gender (LLB-507 & 509 )
cpjcollege
 
Family Law-I ( LLB -201)
Family Law-I  ( LLB -201) Family Law-I  ( LLB -201)
Family Law-I ( LLB -201)
cpjcollege
 
Alternative Dispute Resolution (ADR) [LLB -309]
Alternative Dispute Resolution (ADR) [LLB -309] Alternative Dispute Resolution (ADR) [LLB -309]
Alternative Dispute Resolution (ADR) [LLB -309]
cpjcollege
 
Law of Evidence (LLB-303)
Law of Evidence  (LLB-303) Law of Evidence  (LLB-303)
Law of Evidence (LLB-303)
cpjcollege
 
Environmental Studies and Environmental Laws (: LLB -301)
Environmental Studies and Environmental Laws (: LLB -301)Environmental Studies and Environmental Laws (: LLB -301)
Environmental Studies and Environmental Laws (: LLB -301)
cpjcollege
 
Code of Civil Procedure (LLB -307)
 Code of Civil Procedure (LLB -307) Code of Civil Procedure (LLB -307)
Code of Civil Procedure (LLB -307)
cpjcollege
 
Constitutional Law-I (LLB -203)
 Constitutional Law-I (LLB -203) Constitutional Law-I (LLB -203)
Constitutional Law-I (LLB -203)
cpjcollege
 
Women and Law [LLB 409 (c)]
Women and Law [LLB 409 (c)]Women and Law [LLB 409 (c)]
Women and Law [LLB 409 (c)]
cpjcollege
 
Corporate Law ( LLB- 305)
Corporate Law ( LLB- 305)Corporate Law ( LLB- 305)
Corporate Law ( LLB- 305)
cpjcollege
 
Human Rights Law ( LLB -407)
 Human Rights Law ( LLB -407) Human Rights Law ( LLB -407)
Human Rights Law ( LLB -407)
cpjcollege
 
Labour Law-I (LLB 401)
 Labour Law-I (LLB 401) Labour Law-I (LLB 401)
Labour Law-I (LLB 401)
cpjcollege
 
Legal Ethics and Court Craft (LLB 501)
 Legal Ethics and Court Craft (LLB 501) Legal Ethics and Court Craft (LLB 501)
Legal Ethics and Court Craft (LLB 501)
cpjcollege
 
Political Science-II (BALLB- 209)
Political Science-II (BALLB- 209)Political Science-II (BALLB- 209)
Political Science-II (BALLB- 209)
cpjcollege
 
Health Care Law ( LLB 507 & LLB 509 )
Health Care Law ( LLB 507 & LLB 509 )Health Care Law ( LLB 507 & LLB 509 )
Health Care Law ( LLB 507 & LLB 509 )
cpjcollege
 
Land and Real Estate Laws (LLB-505)
Land and Real Estate Laws (LLB-505)Land and Real Estate Laws (LLB-505)
Land and Real Estate Laws (LLB-505)
cpjcollege
 
Business Environment and Ethical Practices (BBA LLB 213 )
Business Environment and Ethical Practices (BBA LLB 213 )Business Environment and Ethical Practices (BBA LLB 213 )
Business Environment and Ethical Practices (BBA LLB 213 )
cpjcollege
 
HUMAN RESOURCE MANAGEMENT (BBA LLB215 )
HUMAN RESOURCE MANAGEMENT (BBA LLB215 )HUMAN RESOURCE MANAGEMENT (BBA LLB215 )
HUMAN RESOURCE MANAGEMENT (BBA LLB215 )
cpjcollege
 

More from cpjcollege (20)

Tax Law (LLB-403)
Tax Law (LLB-403)Tax Law (LLB-403)
Tax Law (LLB-403)
 
Law and Emerging Technology (LLB -405)
 Law and Emerging Technology (LLB -405) Law and Emerging Technology (LLB -405)
Law and Emerging Technology (LLB -405)
 
Law of Crimes-I ( LLB -205)
 Law of Crimes-I  ( LLB -205)  Law of Crimes-I  ( LLB -205)
Law of Crimes-I ( LLB -205)
 
Socio-Legal Dimensions of Gender (LLB-507 & 509 )
Socio-Legal Dimensions of Gender (LLB-507 & 509 )Socio-Legal Dimensions of Gender (LLB-507 & 509 )
Socio-Legal Dimensions of Gender (LLB-507 & 509 )
 
Family Law-I ( LLB -201)
Family Law-I  ( LLB -201) Family Law-I  ( LLB -201)
Family Law-I ( LLB -201)
 
Alternative Dispute Resolution (ADR) [LLB -309]
Alternative Dispute Resolution (ADR) [LLB -309] Alternative Dispute Resolution (ADR) [LLB -309]
Alternative Dispute Resolution (ADR) [LLB -309]
 
Law of Evidence (LLB-303)
Law of Evidence  (LLB-303) Law of Evidence  (LLB-303)
Law of Evidence (LLB-303)
 
Environmental Studies and Environmental Laws (: LLB -301)
Environmental Studies and Environmental Laws (: LLB -301)Environmental Studies and Environmental Laws (: LLB -301)
Environmental Studies and Environmental Laws (: LLB -301)
 
Code of Civil Procedure (LLB -307)
 Code of Civil Procedure (LLB -307) Code of Civil Procedure (LLB -307)
Code of Civil Procedure (LLB -307)
 
Constitutional Law-I (LLB -203)
 Constitutional Law-I (LLB -203) Constitutional Law-I (LLB -203)
Constitutional Law-I (LLB -203)
 
Women and Law [LLB 409 (c)]
Women and Law [LLB 409 (c)]Women and Law [LLB 409 (c)]
Women and Law [LLB 409 (c)]
 
Corporate Law ( LLB- 305)
Corporate Law ( LLB- 305)Corporate Law ( LLB- 305)
Corporate Law ( LLB- 305)
 
Human Rights Law ( LLB -407)
 Human Rights Law ( LLB -407) Human Rights Law ( LLB -407)
Human Rights Law ( LLB -407)
 
Labour Law-I (LLB 401)
 Labour Law-I (LLB 401) Labour Law-I (LLB 401)
Labour Law-I (LLB 401)
 
Legal Ethics and Court Craft (LLB 501)
 Legal Ethics and Court Craft (LLB 501) Legal Ethics and Court Craft (LLB 501)
Legal Ethics and Court Craft (LLB 501)
 
Political Science-II (BALLB- 209)
Political Science-II (BALLB- 209)Political Science-II (BALLB- 209)
Political Science-II (BALLB- 209)
 
Health Care Law ( LLB 507 & LLB 509 )
Health Care Law ( LLB 507 & LLB 509 )Health Care Law ( LLB 507 & LLB 509 )
Health Care Law ( LLB 507 & LLB 509 )
 
Land and Real Estate Laws (LLB-505)
Land and Real Estate Laws (LLB-505)Land and Real Estate Laws (LLB-505)
Land and Real Estate Laws (LLB-505)
 
Business Environment and Ethical Practices (BBA LLB 213 )
Business Environment and Ethical Practices (BBA LLB 213 )Business Environment and Ethical Practices (BBA LLB 213 )
Business Environment and Ethical Practices (BBA LLB 213 )
 
HUMAN RESOURCE MANAGEMENT (BBA LLB215 )
HUMAN RESOURCE MANAGEMENT (BBA LLB215 )HUMAN RESOURCE MANAGEMENT (BBA LLB215 )
HUMAN RESOURCE MANAGEMENT (BBA LLB215 )
 

Recently uploaded

Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Po-Chuan Chen
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 

Recently uploaded (20)

Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 

Web Technologies

  • 1. Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India) BCA IV WEB TECHNOLOGIES Paper Code 204
  • 2. HTML HTML stands for Hypertext Markup Language It’s a markup language used to structure text and multimedia documents and to set up hypertext links between documents, used extensively on the World Wide Web. HTML was invented in 1990 by a scientist called Tim Berners-Lee Different versions of HTML:- • HTML 2.0(1995) • HTML 3.2(1997) • HTML 4.0(1998) • HTML 4.0.1(1999) • HTML 5 (2008) Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 3. What is needed? • A web browser- Microsoft IE, Google Chrome, Mozilla Firefox etc. • A Text Editor- Notepad(Microsoft Windows) or TextEdit(MAC.) HTML file extension - .htm or .html Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 4. Basic structure of an HTML document <html> <head> <title>Page Title</title> </head> <body> The main part of the document goes here. </body> </html> Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 5. Comment Tag <!-- comments here -->  text within this tag will not be displayed or processed by your browser  comments may be one or multiple lines long (HTML is free-form)  comments do not nest! No comments inside comments! Attributes Tags can also have attributes, which are extra bits of information. Attributes appear inside the opening tag and their values sit inside quotation marks. They look something like <tag attribute="value">Margarine</tag> Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 6. Rules regarding attributes: • Any attributes in an HTML tag need to appear after the HTML tag name. • The attribute name must be followed immediately by an equal sign (=). • The attribute value needs to come immediately after the equal sign. • The attribute value must always be enclosed in quotes, either single or double. Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 7. Meta tag • Meta tags contain information about the page that does not need to be displayed, but it still used by search engines and other web crawlers. They are typically used to give search engines a brief description of the page, as well as the important keywords on it. Meta tags must appear within the head section of the html, and have usually have two of the following attributes: • name="?" - The name of the meta tag, such as description, keywords or author. • . Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 8. Examples • <meta name="Author" content="Jhon Doe" /> • <meta name="keywords" lang="en" content="car, rental, rent" /> • <meta name="keywords" lang="es" content="autos, alquiler, alquila" /> • <meta name="description" lang="en" content="Car rental in New York." /> • <meta http-equiv="expires" content="Mon, 20 Sep 2006 11:09:00 GMT" /> • <meta http-equiv="pragma" content="no-cache" /> • <meta http-equiv="refresh" content="3; URL=http://www.google.com" /> Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 9. HTML <body> Tag • Attributes Example:- <body alink="red" vlink="maroon" link="blue" text="black" bgcolor="white" background="title.jpg"> Attributes value background url bgcolor color text color link color vlink color alink color Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 10. Text Formatting Tags • Header - <h?> </h?>There are 6 levels of headings available, from h1 for the largest and most important heading, down to h6 for the smallest heading. • Bold - <b> </b>The text in between the tags will be bold, and stand out against text around it, the same as in a word processor. • Italic - <i> </i>Also working the same way as a word processor, italics displays the text at a slight angle. • Underline - <u> </u>Again, the same as underline in a word processor. Note that html links are already underlined and don't need the extra tag. • Strike-out - <strike> </strike>Puts a line right through the centre of the text, crossing it out. Often used to show that text is old and no longer relevant. Also works by using <s> </s> instead. Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 11. • Preformatted Text - <pre> </pre>Any text between the pre tags, including spaces, carriage returns and punctuation, will appear in the browser as it would in a text editor (normally browsers ignore multiple spaces) • Source Code - <code> </code>Similar to tt the text is displayed in a fixed-width font, and is commonly used to show source code. I have used it on this site, along with stylesheets, to show all tags. • Typewriter Text - <tt> </tt>The text appears to have been typed by a typewriter, in a fixed-width font. For example: This text is written using the <tt></tt> tags. Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 12. • Small - <small> </small>Instead of having to set a font size, you can use the small tag to render text slightly smaller than the text around it. Useful for displaying the 'fine-print'. • Font Colour - <font color="#??????"> </font>Change the colour of a few words or a section of text. • Font Size - <font size="?"> </font>Replace the ? with a number from 1 to 7 to change the size of the font. One being the smallest and seven the largest. • Font Size Change - <font size="+/-?"> </font>For an immediate change of font size with respect to the font size preceding it, this tag increase or decreases the size of the font by the number you specify. Eg: <font size="-1">Some Text</font>
  • 13. • Change Font Face - <font face="?"> </font>To show text in a particular font, use the font name such "Helvetica" or "Arial" or "Courier". Be aware that using some fancy font from your computer means that the person viewing that page must also have that font installed on their computer too, otherwise it will look totally different to them. • Centre - <center> </center>A useful tag, as it says, it makes everything in between the tags centered (in the middle of the page). • Emphasis - <em> </em>Used to emphasize text, which usually appears in italics, but can vary according to your browser. • Strong Emphasis - <strong> </strong>Used to emphasize text more, which usually appears in bold, but can vary according to your browser.
  • 14. Special HTML Characters • Tag Start - &lt; - < Less-Than symbol, usually used to define the start of an actual HTML tag. • Tag End - &gt; - > Greater-Than symbol, used to declare the end of each tag. • Quotation Marks - &quot; - “ As the name says: to mark a quote, or in html terms: to declare the value of a tag attribute. • Ampersand - &amp; - & It is used to define the start of all special character tags, so it needs a special charachter tag itself.
  • 15. • Non Breaking Space - &nbsp; A space, a plain ordinary space (like when you press the spacebar). The non-breaking part is relevant because multiple spaces in HTML will only show up as one space on your web page. This tag can be used many times in a row to force the web browser to display many spaces on the web page. • Copyright - &copy; - © Copyright indicates ownership of intellectual property. • Trademark - &trade; - ™ Declares a product name or images as business trademark that is not yet registered.
  • 16. • Registered - &reg; - ® Used to indicate that a product or business trademark that is officially registered. • One Half - &frac12; - ½ Fraction symbol for One Half (0.5) of some other value. • Degree - &deg; - ° The degree symbol is used to represent temperature or angular measurements.
  • 17. HTML Linking Tags • Basic Link - <a href="url">link text</a>There are two main parts to a link tag: the text a user can click, and the web address they go to if they click it. The bit between the <a> and </a> tags is the link text, and is generally displayed in blue and underlined by web browsers. The href="url" part is the web address, where url can be set in several ways: href="example.html" - another page in the current • Link to a Fragment - <a href="#fragment">link</a>It is often usefull to link to other places on the same webpage, such as other sections or chapters further down the page. The technical term for this is linking to a Fragment, where browsers will automatically try and scroll to that part of the page. Fragments first need to be defined somewhere in a webpage by giving them a name, for example <a name="fragment_name">, then links to this fragment are created by using the hash (#) character:<a href="#fragment_name">Link</a>. To link to a fragment on another page you would simply append the fragment name to the address, for example: href="example.html#fragment_name". Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 18. • Target Window - <a href="url" target="???">link</a>You may not always want to link to a page and have it load up over the one you are currently viewing. Thats where the target attribute comes in handy. By setting the target="_BLANK" the page you link to will load up in a new window (or new tab in some newer browsers). Similary,"_self", "_parent", or "_top" will open the link in the current window, the parent window. • Image as a Link - <a href="url"><img ...></a>By placing an image tag between the <a> and </a> tags, you can turn an image into a link, and clicking on that image will then load the referenced page. You may notice that the image gets a blue border just as link text became underlined. This can be resolved by setting the border="0"attribute of the image, or using css. Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 19. • Email Link - <a href="mailto:email"></a>A special kind of link, the mailto notation link instructs the browser to compose and email to the specified address using the default email program. It but does not actually send any emails automatically. You can also set a subject for the email by using <a href="mailto:pramod.pandey@jagannath.org?Subject=Linking">email me</a> Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 20.  <img> (no closing tag needed)  used to display graphics (.jpeg, .png, .gif) in your web pages  you must specify the URL for the image source, and an alt= text  the basic attributes of <img> are:  src=”string” - the absolute or relative location of the image file  alt=”string” - Alternate Text for people who don't see images  height=”string” - image height, percent or absolute pixels (optional)  width=”string” - image width, percent or absolute pixels (optional)  title=”string” - mouse-over title of the image (optional) Image tag Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 21. INTRODUCTION TO JAVASCRIPT Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 22. JAVASCRIPT JavaScript is used in millions of Web pages to improve the design, validate forms, detect browsers, create cookies, and much more. JavaScript is the most popular scripting language on the internet, and works in all major browsers, such as Internet Explorer, Mozilla, Firefox, Netscape, Opera. Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 23. WHAT IS JAVASCRIPT? JavaScript was designed to add interactivity to HTML pages JavaScript is a scripting language (a scripting language is a lightweight programming language) A JavaScript consists of lines of executable computer code A JavaScript is usually embedded directly into HTML pages JavaScript is an interpreted language (means that scripts execute without preliminary compilation) Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 24. Are Java and JavaScript the Same? Java and JavaScript are two completely different languages in both concept and design! Java (developed by Sun Microsystems) is a powerful and much more complex programming language - in the same category as C and C++. Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 25. How to Put a JavaScript Into an HTML Page? <html> <body> <script type="text/javascript"> document.write("Hello World!") </script> </body> </html> Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 26. Ending Statements With a Semicolon?With traditional programming languages, like C++ and Java, each code statement has to end with a semicolon (;). Many programmers continue this habit when writing JavaScript, but in general, semicolons are optional! However, semicolons are required if you want to put more than one statement on a single line. Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 27. JavaScript Variables Variables are used to store data. A variable is a "container" for information you want to store. A variable's value can change during the script. You can refer to a variable by name to see its value or to change its value. Rules for variable names: Variable names are case sensitive They must begin with a letter or the underscore character strname – STRNAME (not same) Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 28. JavaScript Operators Operator Description Example Result + Addition x=2 4 y=2 x+y - Subtraction x=5 3 y=2 x-y * Multiplication x=5 20 y=4 x*y / Division 15/5 3 5/2 2,5 % Modulus (division remainder) 5%2 1 10%8 2 10%2 0 ++ Increment x=5 x=6 x++ -- Decrement x=5 x=4 x-- Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 29. JavaScript Operators – 2 Assignment Operators ( Operator Example Is The Same As = x=y x=y += x+=y x=x+y -= x-=y x=x-y *= x*=y x=x*y /= x/=y x=x/y %= x%=y x=x%y Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 30. JavaScript Operators - 3 Comparison Operators Operator Description Example == is equal to 5==8 returns false === is equal to (checks for both value and type) x=5 y="5" x==y returns true x===y returns false != is not equal 5!=8 returns true > is greater than 5>8 returns false < is less than 5<8 returns true >= is greater than or equal to 5>=8 returns false <= is less than or equal to 5<=8 returns true Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 31. JavaScript Operators - 4 Logical Operators Operator Description Example && and x=6 y=3 (x < 10 && y > 1) returns true || or x=6 y=3 (x==5 || y==5) returns false ! not x=6 y=3 !(x==y) returns true Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 32. JavaScript Basic Examples <script> document.write("Hello World!") </script>  format text with HTML code - heading <script> alert("Hello World!") </script> Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 33. Example <script> x=“Hello World!” document.write(x) </script> <script> x=“İsminizi Yazın….” document.write(“Merhaba” +x) </script>  use line break html code Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 34. JavaScript Popup Boxes Alert Box An alert box is often used if you want to make sure information comes through to the user. When an alert box pops up, the user will have to click "OK" to proceed. <script> alert("Hello World!") </script> Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 35. JavaScript Popup Boxes - 2 Confirm Box A confirm box is often used if you want the user to verify or accept something. When a confirm box pops up, the user will have to click either "OK" or "Cancel" to proceed. If the user clicks "OK", the box returns true. If the user clicks "Cancel", the box returns false. Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 36. JavaScript Popup Boxes - 3 Prompt Box A prompt box is often used if you want the user to input a value before entering a page. When a prompt box pops up, the user will have to click either "OK" or "Cancel" to proceed after entering an input value. If the user clicks "OK“, the box returns the input value. If the user clicks "Cancel“, the box returns null. Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 37. Prompt Box Example <script> x=prompt (“Adınızı Yazınız”, “ ”) document.write(“Merhaba <br>”,+x) </script> Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 38. Examples -2 <script> s1=12 s2=28 toplam=s1+s2 document.write("Sayıların toplamı: "+toplam) </script> Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 39. Conditional Statements Very often when you write code, you want to perform different actions for different decisions. You can use conditional statements in your code to do this. In JavaScript we have the following conditional statements: if statement - use this statement if you want to execute some code only if a specified condition is true if...else statement - use this statement if you want to execute some code if the condition is true and another code if the condition is false if...else if....else statement - use this statement if you want to select one of many blocks of code to be executed switch statement - use this statement if you want to select one of many blocks of code to be executed Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 40. What is DHTML? DHTML is the combination of several built-in browser features in fourth generation browsers that enable a web page to be more dynamic. DHTML is NOT a scripting language (like JavaScript or VBscript), but a browser feature- or enhancement- that makes the browser dynamic It uses a host of different technologies - JavaScript, VBScript, the Document Object Model (DOM), layers, cascading stylesheets - to create HTML that can change even after a page has been loaded into a browser Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 41. What is DHTML? It is considered to be made up of –HTML –Cascading Style Sheets (CSS) –Scripting language All three of these components are linked via Document Object Model (DOM) DOM is the interface that allows scripting languages to access the content, style, and structure of the web documents and change them dynamically Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 42. Tools of DTHML HTML and XML –Partitions and Organizes the content CSS –Defines the Presentation of the content Scripting - JavaScript, JScript, VBScript –Adds interactivity to the page DOM- Document Object Model –Defines what and how elements are exposed for script access Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 43. Components of DHTML DHTML requires four independent components to work: HTML, Cascading Style Sheets, Scripting and the Document Object Model. The section provides a brief description of each component. 1. HTML: HTML defines the structure of a Web page, using such basic elements as headings, forms, tables, paragraphs and links. On December 18, 1997, HTML 4.0 attained "recommended" status at the W3C. Changes and enhancements introduced in HTML 4.0 made DHTML possible. 2. Cascading Style Sheets (CSS): Similar to a template in a word- processing document, a style sheet controls the formatting of HTML elements. Like in traditional desktop publishing, one can use style sheet to specify page margins, point sizes and leading. Cascading Style Sheets is a method to determine precedence and to resolve conflicts when multiple styles are used. Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 44. 3. Scripting: Scripting provides the mechanisms to interpret user actions and produce client-side changes to a page. For example, scripts can interpret mouse actions (such as the mouse passing over a specified area of a page through the event model) and respond to the action by using a set of predefined instructions (such as highlighting the text activated by the mouse action). Although DHTML can communicate with several scripting languages, JavaScript is the de facto standard for creating cross-browser DHTML pages. 4. Document Object Model (DOM): The DOM outlines Web page content in a way that makes it possible for HTML elements, style sheets and scripting languages to interact with each other. The W3C defines the DOM as "a platform- and language- neutral interface that will allow programs and scripts to dynamically access and update the content, structure, and style of documents. The document can be further processed and the results of that processing can be incorporated back into the presented stage." Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 45. DOM – Document Object Model Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 46. DOM Introduction Dynamic HTML object model “The Document Object Model (DOM) is an application programming interface (API) for HTML and XML documents. It defines the logical structure of documents and the way a document is accessed and manipulated.” Great control over presentation of pages Access to all elements on the page Whole web page (elements, forms, frames, tables, etc.) represented in an object hierarchy “Anything found in an HTML or XML document can be accessed, changed, deleted, or added using the Document Object Model, with a few exceptions.” Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 47. DOM Introduction – cont’d HTML elements treated as objects Attributes of these elements treated as properties of those objects Objects identified with an ID attribute can be scripted with languages like JavaScript and VBScript. Elements on the page can be supported by scripting that can interact with user events and change the page content dynamically. The DOM dictates how the written scripting language controls the elements on the screen, such as graphics and text. Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 48. DOM-Document Object Model … The Document Object Model is a platform- and language-neutral interface that will allow programs and scripts to dynamically access and update the content, structure and style of the document The DOM details the characteristic properties of each element of a Web page, thereby detailing how we might manipulate these components and, in turn, manipulate the page Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 49. Document Object Model is not a "part" of Scripting languages. The DOM stands alone, able to be interfaced with any programming language designed to do so The W3C DOM is the recommended standard to be exposed by each browser Microsoft Internet Explorer and Netscape do not share the same DOM. DOM-Document Object Model… Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 50.  Both (IE and Netscape) DOMs break down Web pages into roughly four types of components –Objects, Properties, Events and Methods Objects : –Container which reflects a particular element of a page –objects "contain" the properties and methods which apply to that element DOM-Document Object Model… Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 51.  Properties: –Characteristics of an object –Example: the ‘document’ object possesses a ‘bgColor’ property which reflects the background color of the page. –Using a programming language (e.g. JavaScript) you may, via this property, read or modify the background color of a page DOM-Document Object Model… Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 52. Methods: –A method typically executes an action which acts upon the object by which it is owned Events: –Used to trap actions related to its owning object –Typically, these actions are caused by the user DOM-Document Object Model… Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 53. DOM • DOM = Document Object Model Defines a hierarchical model of the document structure through which all document elements may be accessed • Nodes The W3C DOM defines element of a document is a node of a particular type Node Types Common types are: document node, element node, text node, attribute node, comment node, document-type node Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 54. DOM Example document node Document_type node <!DOCTYPE> element node <HTML> element node <HEAD> element node <TITLE> text node "Sample" element node <BODY> element node <P> text node "This is a..." Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 55. Netscape DOM DOM "begins" at the window object; Other objects are below the window object in the hierarchy Exception is the navigator object, (whose properties provide information about the browser version,) which is a peer object of window rather than a child Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 56. Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 57. Microsoft DOM Microsoft indexes an additional topic called as collections. A "collection," is an array-based object The observable difference between the two is the syntax. Netscape supports a treelike hierarchical syntax On the other hand, Internet Explorer exposes all HTML objects as a flat collection and lets you modify the style object Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 58. window document history navigator applets all anchors body embeds forms filters images links plugins styleSheets scripts location screen event document document plugins object collection Key frames Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 59. 15.3 Collections all and children Collections are basically arrays of related objects on a page all Collection of all the HTML elements in a document in the order in which they appear length property Specifies the number of elements in the collection tagName property of an element Determines the name of the element Every element has its own all collection, consisting of all the elements contained within that elementChanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 60. Advantage Robust API for DOM tree Relatively simple to modify data structure and extract data Disadvantage Store entire document in memoryAs DOM was written for any language method naming not follow the standard VB programming conventions Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 61. What is XML XML stands for eXtensible Markup Language. A markup language is used to provide information about a document. Tags are added to the document to provide the extra information. HTML tags tell a browser how to display the document. XML tags give a reader some idea what some of the data means. Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 62. What is XML Used For? XML documents are used to transfer data from one place to another often over the Internet. XML subsets are designed for particular applications. One is RSS (Rich Site Summary or Really Simple Syndication ). It is used to send breaking news bulletins from one web site to another. A number of fields have their own subsets. These include chemistry, mathematics, and books publishing. Most of these subsets are registered with the W3Consortium and are available for anyone’s use. Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 63. Advantages of XML XML is text (Unicode) based. Takes up less space. Can be transmitted efficiently. One XML document can be displayed differently in different media. Html, video, CD, DVD, You only have to change the XML document in order to change all the rest. XML documents can be modularized. Parts can be reused. Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 64. Example of an HTML Document <html> <head><title>Example</title></head. <body> <h1>This is an example of a page.</h1> <h2>Some information goes here.</h2> </body> </html> Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 65. Example of an XML Document <?xml version=“1.0”/> <address> <name>Alice Lee</name> <email>alee@aol.com</email> <phone>212-346-1234</phone> <birthday>1985-03-22</birthday> </address> Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 66. Difference Between HTML and XML HTML tags have a fixed meaning and browsers know what it is. XML tags are different for different applications, and users know what they mean. HTML tags are used for display. XML tags are used to describe documents and data. Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 67. XML Rules Tags are enclosed in angle brackets. Tags come in pairs with start-tags and end-tags. Tags must be properly nested. <name><email>…</name></email> is not allowed. <name><email>…</email><name> is. Tags that do not have end-tags must be terminated by a ‘/’. <br /> is an html example. Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 68. More XML Rules Tags are case sensitive. <address> is not the same as <Address> XML in any combination of cases is not allowed as part of a tag. Tags may not contain ‘<‘ or ‘&’. Tags follow Java naming conventions, except that a single colon and other characters are allowed. They must begin with a letter and may not contain white space. Documents must have a single root tag that begins the document. Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 69. Encoding XML (like Java) uses Unicode to encode characters. Unicode comes in many flavors. The most common one used in the West is UTF-8. UTF-8 is a variable length code. Characters are encoded in 1 byte, 2 bytes, or 4 bytes. The first 128 characters in Unicode are ASCII. In UTF-8, the numbers between 128 and 255 code for some of the more common characters used in western Europe, such as ã, á, å, or ç. Two byte codes are used for some characters not listed in the first 256 and some Asian ideographs. Four byte codes can handle any ideographs that are left. Those using non-western languages should investigate other versions of Unicode. Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 70. Well-Formed Documents An XML document is said to be well-formed if it follows all the rules. An XML parser is used to check that all the rules have been obeyed. Recent browsers such as Internet Explorer 5 and Netscape 7 come with XML parsers. Parsers are also available for free download over the Internet. One is Xerces, from the Apache open- source project. Java 1.4 also supports an open-source parser. Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 71. XML Example Revisited <?xml version=“1.0”/> <address> <name>Alice Lee</name> <email>alee@aol.com</email> <phone>212-346-1234</phone> <birthday>1985-03-22</birthday> </address> Markup for the data aids understanding of its purpose. A flat text file is not nearly so clear. Alice Lee alee@aol.com 212-346-1234 1985-03-22 The last line looks like a date, but what is it for?Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 72. Expanded Example <?xml version = “1.0” ?> <address> <name> <first>Alice</first> <last>Lee</last> </name> <email>alee@aol.com</email> <phone>123-45-6789</phone> <birthday> <year>1983</year> <month>07</month> <day>15</day> </birthday> </address> Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 73. XML Files are Trees address name email phone birthday first last year month day Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 74. XML Trees An XML document has a single root node. The tree is a general ordered tree. A parent node may have any number of children. Child nodes are ordered, and may have siblings. Preorder traversals are usually used for getting information out of the tree. Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 75. Validity A well-formed document has a tree structure and obeys all the XML rules. A particular application may add more rules in either a DTD (document type definition) or in a schema. Many specialized DTDs and schemas have been created to describe particular areas. These range from disseminating news bulletins (RSS) to chemical formulas. DTDs were developed first, so they are not as comprehensive as schema. Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 76. Document Type Definitions A DTD describes the tree structure of a document and something about its data. There are two data types, PCDATA and CDATA. PCDATA is parsed character data. CDATA is character data, not usually parsed. A DTD determines how many times a node may appear, and how child nodes are ordered. Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 77. DTD for address Example <!ELEMENT address (name, email, phone, birthday)> <!ELEMENT name (first, last)> <!ELEMENT first (#PCDATA)> <!ELEMENT last (#PCDATA)> <!ELEMENT email (#PCDATA)> <!ELEMENT phone (#PCDATA)> <!ELEMENT birthday (year, month, day)> <!ELEMENT year (#PCDATA)> <!ELEMENT month (#PCDATA)> <!ELEMENT day (#PCDATA)> Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 78. Schemas Schemas are themselves XML documents. They were standardized after DTDs and provide more information about the document. They have a number of data types including string, decimal, integer, boolean, date, and time. They divide elements into simple and complex types. They also determine the tree structure and how many children a node may have. Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 79. Schema for First address Example <?xml version="1.0" encoding="ISO-8859-1" ?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="address"> <xs:complexType> <xs:sequence> <xs:element name="name" type="xs:string"/> <xs:element name="email" type="xs:string"/> <xs:element name="phone" type="xs:string"/> <xs:element name="birthday" type="xs:date"/> </xs:sequence> </xs:complexType> </xs:element> </xs:schema> Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 80. Explanation of Example Schema <?xml version="1.0" encoding="ISO-8859-1" ?> ISO-8859-1, Latin-1, is the same as UTF-8 in the first 128 characters. <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> www.w3.org/2001/XMLSchema contains the schema standards. <xs:element name="address"> <xs:complexType> This states that address is a complex type element. <xs:sequence> This states that the following elements form a sequence and must come in the order shown. <xs:element name="name" type="xs:string"/> This says that the element, name, must be a string. <xs:element name="birthday" type="xs:date"/> This states that the element, birthday, is a date. Dates are always of the form yyyy-mm-dd. Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 81. XSLT Extensible Stylesheet Language Transformations XSLT is used to transform one xml document into another, often an html document. The Transform classes are now part of Java 1.4. A program is used that takes as input one xml document and produces as output another. If the resulting document is in html, it can be viewed by a web browser. This is a good way to display xml data. Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 82. A Style Sheet to Transform address.xml <?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="address"> <html><head><title>Address Book</title></head> <body> <xsl:value-of select="name"/> <br/><xsl:value-of select="email"/> <br/><xsl:value-of select="phone"/> <br/><xsl:value-of select="birthday"/> </body> </html> </xsl:template> </xsl:stylesheet> Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
  • 83. Parsers There are two principal models for parsers. SAX – Simple API for XML Uses a call-back method Similar to javax listeners DOM – Document Object Model Creates a parse tree Requires a tree traversal Chanderprabhu Jain College of Higher Studies & School of Law Plot No. OCF, Sector A-8, Narela, New Delhi – 110040 (Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)