Module 2 - Front End Development
Module 2 - Front End Development
(New Syllabus wef academic year 21-22) (MS-67)
{Front End Dovelopment...Paga no. (2-18)
Sons a a
JavaScript Navigator Object
sserpt>
Mocument.wrteln("
navigaior.ppCodeName:
‘navigator. appCodeName);
ocumentriteln("'
navigator.appName:
/ +avigatorapp Name);
document. writeln(”
navigator.cookieEnabled:
* + nnvgator.cookieEnable)
document. writeln(*
navigator platform:
4 navigator platform);
tor.userAgent);
previous, forward or any arcu page.
The history object is the window propery, soit ean be
accessed by:
‘window history
oR
history
© Properties of JavaScript history object
Property. Description
Length specifies the number of elements
contained in the object
Cureat specifies the URL of the cureat entry
inthe object
Next specifies the URL of the next ekment
inthe History list
previous specifies the URL of the pevious
element in the History ist
|F Methods of JavaScript history object
‘There are only 3 methods of history object.
Method Description
forward) loads the next page.
back) Toads the previous page.
20) Joads the given page nurer.
Example
sment.writeln("
navigator.onLine:
Pi ariguoronLine); histo forward nex page
oe ‘istory-g0(2);/ffor next 2nd page
Ue bina g2)ifoc revi 2nd page
(New Syllabus w.e, academic year 21-22) (M5-67)
Ll reeh-Neo Pubcations.A SACHIN SHAH VentureJetemet Programming (MU ~ Sem 5 Comp.) (Front End Development...Page no. (2-26)
penne
'
ere
GQ. Whats the purpose of Location browser objects in JavaScript Explain ts methods.
+ The location object in JavaScript helps in storing the information of eurent URL of the window objet tsa chil object of the
window objet
+ _Thetahe given below describes the properties af the Location objet aaSerip.
Property. Description Example
Tet | represents a string specifying the entire URL itp PhoenixGlobe com A0MuestaspTid= estat
protocol. | represents a string at the beginning of a URL up to the first colon (3, | http: or hips:
which specifies the method of access to the URL
ost | repens sting consisting of the hostname and pot sings FhoenixGobecom60
Tesmame | rein the server mame subdomain, nd donsin ame of URL. | PhoenxGlob-com
Port ‘represents a string specifying the communications port that the server uses_| 80
pathname | represen a sing portion of URL speciing how a parc sauce | testasp
canbe acessed
search| repeats a ing bepnning witha question mark hat spe ay gory
infra in an HTTP URL
Tash | represents sing beginning with a serfs an anchor rane in an | stat
HITPURL
Location Object Methods Patimamefldalus
“The following ble ists the methods ofthe Loeaon object Se :
interact sleaiot>
aE ‘
© Method | apes
assign() Loads a new document in the browser “Enter URL in following sections
reload) reloads the current document that is contained
inthe cation href propery
coment with the || <*
replace) | poces, the creat” document ption>hitpl/
ler
© feyjicrsmt.nont
> 04
Enter URL in following sections
Protocol:
trtomet Programming (MU - Sem 5 = Comp) (Front End Dovolopmant)....Paga no. (2-27)
Any element of IITML. page can be acceee byw
phe
Mhocument objet
‘Acconting to WSC(World Wide Web Convo) “The
WIC Document Object Model (DOM) i platform and language
reutal interface tat allows programs and scripts to dymamisly
“| secess and update the content, structure, and style of document.”
'T Hierarchy of objects In web document
Document Object Model (DOM) is the metho by which he
content of documents accesel and modified. Ina weh document,
the organization of ebjeets is implemented in irachial
sinctu.
% 2.8.1 DOM Levels
‘The DOM provides JavaScript with ll of the fears itteeds
to generate dynamic HTML:
Changes can be made in all HTML elements.
‘The eae buml documeat is represented by the documest
jet.
‘The band document becomes document cbject when itis
ended in the browser. The rot element represents the inl
ocumeat. The document object as popes and metho
‘Tae documeat object helps to add content dynamically inte
rate Changes cnbe mein es of TL eet
sostuas! Changs canbe main CSS sys inthe age.
[PhoesixGiobe.com ‘+ Existing HTML elements and attributes can be deleted.
dane: «New HTML leents nd aur can beste
a
‘+ Response can be given to HTML events.
Go,
4 NewETTL evenscanbe cet in TM pe
SG wan
_ __ Erne [iraort set
paizi8 DOCUMENT OBJECT MODEL a ee!
Te] ee] [oa
—_—
fu
Fado] | [oa
‘© DOM stands for Document Objet Model, [Pesscon
Flg.2811 : DOM levels
web pe
(New jlabus wef academic year 21-22) (M5-67)
[Bb rech-teoPubcations.A SACHIN SHAH Vertue
Modal
k 2 4sctemet Programming (MU: Som8 = Comp)
YS 2.8.2 Propertles and Methods of Document
Object
‘The contents of document can be accessed and modified with
the help of methods,
ee
Method I Properties Description
Value Retums value of specified
textfield
write(string?) Weites the specified string
in the document,
WritelaC string") Writes the specified sting
inthe document with
‘newline character atthe
end.
J
{Front End Davelopment)..Page no. (2-28)
"orm |*>
Ener Your Name: