Zero To Hero
Zero To Hero
Audience
This tutorial has been prepared for JavaScript beginners to help them understand
the basic functionality of JavaScript to build dynamic web pages and web
applications.
Prerequisites
For this tutorial, it is assumed that the reader have a prior knowledge of HTML
coding. It would help if the reader had some prior exposure to object-oriented
programming concepts and a general idea on creating online applications.
All the content and graphics published in this e-book are the property of Tutorials
Point (I) Pvt. Ltd. The user of this e-book is prohibited to reuse, retain, copy,
distribute or republish any contents or a part of contents of this e-book in any
manner without written consent of the publisher.
We strive to update the contents of our website and tutorials as timely and as
precisely as possible, however, the contents may contain inaccuracies or errors.
Tutorials Point (I) Pvt. Ltd. provides no guarantee regarding the accuracy,
timeliness or completeness of our website or its contents including this tutorial. If
you discover any errors on our website or in this tutorial, please notify us at
[email protected]
i
Table of Contents
About the Tutorial .............................................................................................................................................
Audience ........................................................................................................................................................... i
Prerequisites ..................................................................................................................................................... i
Copyright and Disclaimer ................................................................................................................................. i
Table of Contents ............................................................................................................................................ ii
iii
16. JAVASCRIPT – Page Redirect ................................................................................................................... 89
What is Page Redirection? ............................................................................................................................. 89
JavaScript Page Refresh ................................................................................................................................. 89
Auto Refresh .................................................................................................................................................. 89
How Page Re-direction Works? ..................................................................................................................... 90
v
indexOf () ..................................................................................................................................................... 192
join () ........................................................................................................................................................... 195
lastIndexOf () ............................................................................................................................................... 196
map () .......................................................................................................................................................... 199
pop () ........................................................................................................................................................... 201
push () .......................................................................................................................................................... 202
reduce () ...................................................................................................................................................... 204
reduceRight () .............................................................................................................................................. 207
reverse () ..................................................................................................................................................... 211
shift () .......................................................................................................................................................... 212
slice () .......................................................................................................................................................... 213
some () ......................................................................................................................................................... 214
sort () ........................................................................................................................................................... 216
splice () ........................................................................................................................................................ 217
toString () ..................................................................................................................................................... 219
unshift () ...................................................................................................................................................... 220
vi
setUTCDate () .............................................................................................................................................. 254
setUTCFullYear () ......................................................................................................................................... 255
setUTCHours () ............................................................................................................................................ 257
setUTCMilliseconds () .................................................................................................................................. 258
setUTCMinutes () ......................................................................................................................................... 259
setUTC Month () .......................................................................................................................................... 260
setUTCSeconds () ......................................................................................................................................... 261
setYear () ..................................................................................................................................................... 262
toDateString () ............................................................................................................................................. 263
toGMTString () ............................................................................................................................................. 264
toLocaleDateString () ................................................................................................................................... 265
toLocaleDateString () ................................................................................................................................... 266
toLocaleFormat () ........................................................................................................................................ 266
toLocaleString () .......................................................................................................................................... 267
toLocaleTimeSring () .................................................................................................................................... 268
toSource () ................................................................................................................................................... 269
toString () ..................................................................................................................................................... 270
toTimeString () ............................................................................................................................................. 271
toUTCString () .............................................................................................................................................. 272
valeOf () ....................................................................................................................................................... 273
Date Static Methods .................................................................................................................................... 274
Date.parse ( ) ............................................................................................................................................... 274
Date.UTC ( ) ................................................................................................................................................. 275
vii
sin ( ) ............................................................................................................................................................ 305
sqrt ( ) .......................................................................................................................................................... 306
tan ( ) ........................................................................................................................................................... 307
toSource ( ) .................................................................................................................................................. 309
ix