SlideShare une entreprise Scribd logo
1  sur  18
www.ustudy.in
History objects are predefined objects
which contains the complete information
about the links and URL’s visited during
the session.
www.ustudy.in
• length:
• The length property of the history object returns
the number of elements in the history list.
• General syntax of length property of history
Object:
– history.length
www.ustudy.in
<html>
<body>
<script type="text/javascript">
var ex = history.length;
document.write("The number of pages visited
before this page is" +ex+ " pages!!!.")
</script>
</body>
</html>
www.ustudy.in
• The output of the above program is
• The number of pages visited before this page is
5 pages!!!
• This means that there are 5 entries in the
history list and denotes the number of pages
visited before visiting the current page.
www.ustudy.in
• This property contains the complete URL of
the current History entry.
• General syntax of current property of history
Object:
• history.current
www.ustudy.in
• The next property of history object contains the
complete URL of the next element in the History
list. This functionality or the URL visited is the
same as pressing the forward button or menu.
• General syntax of next property of history Object:
• history.next
www.ustudy.in
• The previous property of history object contains
the complete URL of the previous element in the
History list. This functionality or the URL visited is
the same as pressing the back button or menu.
• General syntax of previous property of history
Object:
• history.previous
www.ustudy.in
• back():
• There may be scenarios where the programmer wishes to load the
previous URL present in the history list. In this case, the
programmer can make use of the back() method of the history
object. The back() method of the history object takes the user to
the previous page. The functionality results in the same as pressing
the back button of the browser.
• General syntax of back method of history Object:
• history.back()
www.ustudy.in
www.ustudy.in
<html>
<head>
<script type="text/javascript">
function funback()
{
window.history.back()
}
</script>
</head>
<body>
<input type="button" value="Press the Button to go
to Previous Page!!!" onclick="funback()" />
</body>
</html>
• The output of the above program is a button
with message as
• Press the Button to go to Previous Page!!!
• When this button is pressed, the control is
navigated to the previous page.
www.ustudy.in
• The forward() method of the history object loads
the next URL in the History list. The functionality
results are the same as pressing the forward
button of the browser.
• General syntax of forward method of history
Object:
• history.forward()
www.ustudy.in
www.ustudy.in
<html>
<head>
<script type="text/javascript">
function funfor()
{
window.history.forward()
}
</script>
</head>
<body>
<input type="button" value="Press the Button to go
to Next Page!!!" onclick="funfor()" />
</body>
</html>
• The output of the above program is a button
with message as
• Press the Button to go to Next Page!!!
• When this button is pressed, the control is
navigated to next page (to the next URL) in the
history list.
www.ustudy.in
• If the programmer wishes to load a specified URL from the
History list, then the go method of history object can be
used.
• General syntax of go method of history Object:
• history.go(number) or history.go(URL)
• The back method seen above is the same as history.go(-1) in
terms of go method of history object. The forward method
seen above is the same as history.go(1)
www.ustudy.in
www.ustudy.in
<html>
<head>
<script type="text/javascript">
function funfor()
{
window.history.go(1)
}
</script>
</head>
<body>
<input type="button" value="Press the Button to go
to Next Page!!!" onclick="funfor()" />
</body>
</html>
The output of the above program loads the next page in the history list.
• http://www.w3schools.com/jsref/obj_history.as
p
• http://www.exforsys.com/tutorials/javascript/ja
vascript-history-object-properties-and-
methods.html
www.ustudy.in
www.ustudy.in

Contenu connexe

En vedette

Python Programming - IV. Program Components (Functions, Classes, Modules, Pac...
Python Programming - IV. Program Components (Functions, Classes, Modules, Pac...Python Programming - IV. Program Components (Functions, Classes, Modules, Pac...
Python Programming - IV. Program Components (Functions, Classes, Modules, Pac...Ranel Padon
 
Python Programming - XIII. GUI Programming
Python Programming - XIII. GUI ProgrammingPython Programming - XIII. GUI Programming
Python Programming - XIII. GUI ProgrammingRanel Padon
 
Decision statements in vb.net
Decision statements in vb.netDecision statements in vb.net
Decision statements in vb.netilakkiya
 
File handling in vb.net
File handling in vb.netFile handling in vb.net
File handling in vb.netEverywhere
 
Looping statement in vb.net
Looping statement in vb.netLooping statement in vb.net
Looping statement in vb.netilakkiya
 
Mobile Application
Mobile ApplicationMobile Application
Mobile ApplicationShyam Sir
 
Operators , Functions and Options in VB.NET
Operators , Functions and Options in VB.NETOperators , Functions and Options in VB.NET
Operators , Functions and Options in VB.NETShyam Sir
 

En vedette (8)

Python Programming - IV. Program Components (Functions, Classes, Modules, Pac...
Python Programming - IV. Program Components (Functions, Classes, Modules, Pac...Python Programming - IV. Program Components (Functions, Classes, Modules, Pac...
Python Programming - IV. Program Components (Functions, Classes, Modules, Pac...
 
Python Programming - XIII. GUI Programming
Python Programming - XIII. GUI ProgrammingPython Programming - XIII. GUI Programming
Python Programming - XIII. GUI Programming
 
Decision statements in vb.net
Decision statements in vb.netDecision statements in vb.net
Decision statements in vb.net
 
File handling in vb.net
File handling in vb.netFile handling in vb.net
File handling in vb.net
 
Looping statement in vb.net
Looping statement in vb.netLooping statement in vb.net
Looping statement in vb.net
 
Introduction to VB.NET - UP SITF
Introduction to VB.NET - UP SITFIntroduction to VB.NET - UP SITF
Introduction to VB.NET - UP SITF
 
Mobile Application
Mobile ApplicationMobile Application
Mobile Application
 
Operators , Functions and Options in VB.NET
Operators , Functions and Options in VB.NETOperators , Functions and Options in VB.NET
Operators , Functions and Options in VB.NET
 

Similaire à History object

Applied component i unit 2
Applied component i unit 2Applied component i unit 2
Applied component i unit 2Pramod Redekar
 
Java script frame history
Java script frame historyJava script frame history
Java script frame historyH K
 
Learn javascript easy steps
Learn javascript easy stepsLearn javascript easy steps
Learn javascript easy stepsprince Loffar
 
Easy javascript
Easy javascriptEasy javascript
Easy javascriptBui Kiet
 
Java script browser objects 1
Java script browser objects 1Java script browser objects 1
Java script browser objects 1H K
 
Dom(document object model)
Dom(document object model)Dom(document object model)
Dom(document object model)Partnered Health
 
An Introduction to HTML5
An Introduction to HTML5An Introduction to HTML5
An Introduction to HTML5Steven Chipman
 
Introduction to html
Introduction to htmlIntroduction to html
Introduction to htmleShikshak
 
W3Conf slides - The top web features from caniuse.com you can use today
W3Conf slides - The top web features from caniuse.com you can use todayW3Conf slides - The top web features from caniuse.com you can use today
W3Conf slides - The top web features from caniuse.com you can use todayadeveria
 
Dom date and objects and event handling
Dom date and objects and event handlingDom date and objects and event handling
Dom date and objects and event handlingsmitha273566
 
Std 12 Computer Chapter 1 Creating Html Forms Using KompoZer
Std 12 Computer Chapter 1 Creating Html Forms Using KompoZerStd 12 Computer Chapter 1 Creating Html Forms Using KompoZer
Std 12 Computer Chapter 1 Creating Html Forms Using KompoZerNuzhat Memon
 
Javascript part 2 DOM.pptx
Javascript part 2 DOM.pptxJavascript part 2 DOM.pptx
Javascript part 2 DOM.pptxdeepa339830
 
Frontend for developers
Frontend for developersFrontend for developers
Frontend for developersHernan Mammana
 
How we improved performance at Mixbook
How we improved performance at MixbookHow we improved performance at Mixbook
How we improved performance at MixbookAnton Astashov
 
Advanced JQuery Mobile tutorial with Phonegap
Advanced JQuery Mobile tutorial with Phonegap Advanced JQuery Mobile tutorial with Phonegap
Advanced JQuery Mobile tutorial with Phonegap Rakesh Jha
 

Similaire à History object (20)

Applied component i unit 2
Applied component i unit 2Applied component i unit 2
Applied component i unit 2
 
Java script frame history
Java script frame historyJava script frame history
Java script frame history
 
Learn javascript easy steps
Learn javascript easy stepsLearn javascript easy steps
Learn javascript easy steps
 
JQuery
JQueryJQuery
JQuery
 
Javascript dom
Javascript domJavascript dom
Javascript dom
 
Easy javascript
Easy javascriptEasy javascript
Easy javascript
 
Java script browser objects 1
Java script browser objects 1Java script browser objects 1
Java script browser objects 1
 
Dom(document object model)
Dom(document object model)Dom(document object model)
Dom(document object model)
 
An Introduction to HTML5
An Introduction to HTML5An Introduction to HTML5
An Introduction to HTML5
 
Introduction to html
Introduction to htmlIntroduction to html
Introduction to html
 
W3Conf slides - The top web features from caniuse.com you can use today
W3Conf slides - The top web features from caniuse.com you can use todayW3Conf slides - The top web features from caniuse.com you can use today
W3Conf slides - The top web features from caniuse.com you can use today
 
Dom date and objects and event handling
Dom date and objects and event handlingDom date and objects and event handling
Dom date and objects and event handling
 
Std 12 Computer Chapter 1 Creating Html Forms Using KompoZer
Std 12 Computer Chapter 1 Creating Html Forms Using KompoZerStd 12 Computer Chapter 1 Creating Html Forms Using KompoZer
Std 12 Computer Chapter 1 Creating Html Forms Using KompoZer
 
Javascript part 2 DOM.pptx
Javascript part 2 DOM.pptxJavascript part 2 DOM.pptx
Javascript part 2 DOM.pptx
 
HTML5 - An introduction
HTML5 - An introductionHTML5 - An introduction
HTML5 - An introduction
 
Frontend for developers
Frontend for developersFrontend for developers
Frontend for developers
 
Spsl v unit - final
Spsl v unit - finalSpsl v unit - final
Spsl v unit - final
 
Javascript
Javascript Javascript
Javascript
 
How we improved performance at Mixbook
How we improved performance at MixbookHow we improved performance at Mixbook
How we improved performance at Mixbook
 
Advanced JQuery Mobile tutorial with Phonegap
Advanced JQuery Mobile tutorial with Phonegap Advanced JQuery Mobile tutorial with Phonegap
Advanced JQuery Mobile tutorial with Phonegap
 

Plus de ilakkiya

Twisted pair cable
Twisted pair cableTwisted pair cable
Twisted pair cableilakkiya
 
Network topology
Network topologyNetwork topology
Network topologyilakkiya
 
Looping statement
Looping statementLooping statement
Looping statementilakkiya
 
Conditional statement
Conditional statementConditional statement
Conditional statementilakkiya
 
Data types in php
Data types in phpData types in php
Data types in phpilakkiya
 
Array in php
Array in phpArray in php
Array in phpilakkiya
 
Addressing mode
Addressing modeAddressing mode
Addressing modeilakkiya
 

Plus de ilakkiya (8)

Twisted pair cable
Twisted pair cableTwisted pair cable
Twisted pair cable
 
Infrared
InfraredInfrared
Infrared
 
Network topology
Network topologyNetwork topology
Network topology
 
Looping statement
Looping statementLooping statement
Looping statement
 
Conditional statement
Conditional statementConditional statement
Conditional statement
 
Data types in php
Data types in phpData types in php
Data types in php
 
Array in php
Array in phpArray in php
Array in php
 
Addressing mode
Addressing modeAddressing mode
Addressing mode
 

Dernier

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Principled Technologies
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 

Dernier (20)

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 

History object