SlideShare a Scribd company logo
Lecture 20
Referring to Unnamed
Frames Numerically
This is the last topic with using Frames in JavaScript. Like we did with Forms, same is
the case with Frames. If we don’t give any name to forms, then in JavaScript first form is
referred as forms [0], second form is referred as forms [1]. This is because; JavaScript
maintains an array of all the forms.
Similarly, if frames are unnamed, i.e. we don’t give any name to frames, then in
JavaScript first frame is referred as frames [0], second frame is referred as frames [1],
and so on.

Let us take an example.
Below is the code for frameset.html
<HTML>
        <frameset cols="50%,50%">
               <frame src="frame1.html">
               <frame src="frame2.html">
</frameset>
</HTML>

Below is the code for frame1.hmtl
<HTML>
<HEAD>
<TITLE> Frame 1</TITLE>
<script language="JavaScript">
        function fn1()
        {
                window.alert("This is function in frame 1");
        }
</script>
</HEAD>
<BODY>
        This is frame 1 <br>
        <a href="#" onClick="parent.frames[1].fn1()"> Call Function in Frame2</a>
</BODY>
</HTML>

Below is the code for frame2.html
<HTML>
<HEAD>
<TITLE> Frame 2</TITLE>
<script language="JavaScript">
        function fn1()
        {
window.alert("This is function in frame 2");
        }
</script>
</HEAD>
<BODY>
        This is frame 2 <br>
        <a href="#" onClick="parent.frames[0].fn1()"> Call Function in Frame1</a>
</BODY>
</HTML>


History Object
History Object Properties

   •   Length: Returns the number of items in the current history list

History Object Methods

   •   Back(): Moves back n items in the history list
   •   Forward(): Moves forward n items in the history list
   •   Go(): Moves to item n in the history list

There are currently no History object events. This means you cannot associate any event
with the History object.

History object contains the list of URL’s that your browser has visited. In other words,
History object is an array of all URL’s visited so far with the current open browser.

Since History object is an array, so it must have a length property, which will give you
the number of URL visited so far.

 Generally, if you want to go back to the previous page, you click the back button in the
menu bar of your browser. And, in case you want to go back to the next page, you click
the forward button
Notice: When you open a browser, back and forward button both are disabled.

If you want, you can provide that buttons on your web page, so that user can move back
and forward using your buttons rather than using browser buttons.




There are three ways to implement back and forward buttons
1. Back and Forward Using History
   2. Back and Forward Buttons (Simple)
   3. Back and Forward Buttons Without History

Back and Forward Using History
      Now, we will understand How to code back and forward button using history.

Below is the code
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<script LANGUAGE="JavaScript">
        function back()
        {
               history.go(-1);
        }

        function forward()
        {
               history.go(+1);
        }
</script>
</HEAD>

<BODY>
<FORM>
<INPUT TYPE="button" VALUE="<< Back" onClick="back()">
<INPUT TYPE="button" VALUE="Forward >>" onClick="forward()">
</FORM>
</BODY>
</HTML>

Back and Forward Button (Simplest Way)

<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<script LANGUAGE="JavaScript">
        function back()
        {
               Location.href=”a.html”;
        }

       function forward()
       {
              Location.href=”b.html”
}
</script>
</HEAD>

<BODY>
<INPUT TYPE="button" VALUE="<< Back" onClick="back()">
<INPUT TYPE="button" VALUE="Forward >>" onClick="forward()">
</BODY>
</HTML>

Back and Forward buttons without using history object

<script language="JavaScript">

var MyLocation=window.location;

var MyPage=new Array;

{

       MyPage[0]="index.html";

       MyPage[1]="alerts.htm";

       MyPage[2]="alertsText.htm";

       MyPage[3]="alertsImages.htm";

       MyPage[4]="jumpfunction.htm";

       MyPage[5]="alertConfirm.htm";

       MyPage[6]="alertConfirm2Locs.htm";

       MyPage[7]="alertOnLoad.htm";

       MyPage[8]="alertHelloEx.htm";

       MyPage[9]="alertPrompts.htm";

       MyPage[10]="documentWrite.htm";

       MyPage[11]="documentWrite2.htm";
MyPage[12]="WindowNew.htm";

      MyPage[13]="WindowNew2.htm";

      MyPage[14]="WindowNewHyperlinks.htm";

      MyPage[15]="menu1.htm";

      MyPage[16]="menuSelectOnChange.htm";

      MyPage[17]="ArrayText.htm";

      MyPage[18]="jsFrames.htm";

      MyPage[19]="frameHyperlinks.htm";

      MyPage[20]="BackForward.htm"; }

function GoBack() {

if (ThisPageNumber <=0) {

alert("You are at the beginning of this series");

}

else{ ThisPageNumber=ThisPageNumber-1;

window.location=MyPage[ThisPageNumber];

}}

function GoForward(){

ThisPageNumber=ThisPageNumber+1;

if (ThisPageNumber >=MyPage.length) {

answer=confirm("You are at the end of the present series. "+

"Press ok to go to the beginning. Cancel to stay here");

if (answer!=0) {
ThisPageNumber=0; window.location=MyPage[ThisPageNumber]; }
ThisPageNumber=ThisPageNumber-1;

}

else {

window.location=MyPage[ThisPageNumber];

}

}

</script>

More Related Content

What's hot

Javascript Experiment
Javascript ExperimentJavascript Experiment
Javascript Experiment
wgamboa
 
5. CodeIgniter copy1
5. CodeIgniter copy15. CodeIgniter copy1
5. CodeIgniter copy1
Razvan Raducanu, PhD
 
Asp 3-html helpers in asp.net
Asp 3-html helpers in asp.netAsp 3-html helpers in asp.net
Asp 3-html helpers in asp.net
Fajar Baskoro
 
13. view data
13. view data13. view data
13. view data
Razvan Raducanu, PhD
 
Jqeury ajax plugins
Jqeury ajax pluginsJqeury ajax plugins
Jqeury ajax plugins
Inbal Geffen
 
Borrar
BorrarBorrar
Lesson 202 02 oct13-1800-ay
Lesson 202 02 oct13-1800-ayLesson 202 02 oct13-1800-ay
Lesson 202 02 oct13-1800-ay
Codecademy Ren
 
UIWebView Tips
UIWebView TipsUIWebView Tips
UIWebView Tips
Katsumi Kishikawa
 
Url&doc html
Url&doc htmlUrl&doc html
Url&doc html
akila m
 
Intro to DTCoreText: Moving Past UIWebView | iOS Development
Intro to DTCoreText: Moving Past UIWebView | iOS DevelopmentIntro to DTCoreText: Moving Past UIWebView | iOS Development
Intro to DTCoreText: Moving Past UIWebView | iOS Development
SmartLogic
 
5. hello popescu
5. hello popescu5. hello popescu
5. hello popescu
Razvan Raducanu, PhD
 
XPages Extension Library - Create an app in 1 hour (almost)
XPages Extension Library - Create an app in 1 hour (almost)XPages Extension Library - Create an app in 1 hour (almost)
XPages Extension Library - Create an app in 1 hour (almost)
Per Henrik Lausten
 
jQuery basics for Beginners
jQuery basics for BeginnersjQuery basics for Beginners
jQuery basics for Beginners
Pooja Saxena
 
Java script
Java scriptJava script
symfony & jQuery (phpDay)
symfony & jQuery (phpDay)symfony & jQuery (phpDay)
symfony & jQuery (phpDay)
Massimiliano Arione
 
Laravel the right way
Laravel   the right wayLaravel   the right way
Laravel the right way
Matheus Marabesi
 
Broadleaf Presents Thymeleaf
Broadleaf Presents ThymeleafBroadleaf Presents Thymeleaf
Broadleaf Presents Thymeleaf
Broadleaf Commerce
 
HTML Forms
HTML FormsHTML Forms
HTML Forms
bismakhan12
 
Advanced Interfaces and Repositories in Laravel
Advanced Interfaces and Repositories in LaravelAdvanced Interfaces and Repositories in Laravel
Advanced Interfaces and Repositories in Laravel
Jonathan Behr
 
CGI::Prototype (NPW 2006)
CGI::Prototype (NPW 2006)CGI::Prototype (NPW 2006)
CGI::Prototype (NPW 2006)
brian d foy
 

What's hot (20)

Javascript Experiment
Javascript ExperimentJavascript Experiment
Javascript Experiment
 
5. CodeIgniter copy1
5. CodeIgniter copy15. CodeIgniter copy1
5. CodeIgniter copy1
 
Asp 3-html helpers in asp.net
Asp 3-html helpers in asp.netAsp 3-html helpers in asp.net
Asp 3-html helpers in asp.net
 
13. view data
13. view data13. view data
13. view data
 
Jqeury ajax plugins
Jqeury ajax pluginsJqeury ajax plugins
Jqeury ajax plugins
 
Borrar
BorrarBorrar
Borrar
 
Lesson 202 02 oct13-1800-ay
Lesson 202 02 oct13-1800-ayLesson 202 02 oct13-1800-ay
Lesson 202 02 oct13-1800-ay
 
UIWebView Tips
UIWebView TipsUIWebView Tips
UIWebView Tips
 
Url&doc html
Url&doc htmlUrl&doc html
Url&doc html
 
Intro to DTCoreText: Moving Past UIWebView | iOS Development
Intro to DTCoreText: Moving Past UIWebView | iOS DevelopmentIntro to DTCoreText: Moving Past UIWebView | iOS Development
Intro to DTCoreText: Moving Past UIWebView | iOS Development
 
5. hello popescu
5. hello popescu5. hello popescu
5. hello popescu
 
XPages Extension Library - Create an app in 1 hour (almost)
XPages Extension Library - Create an app in 1 hour (almost)XPages Extension Library - Create an app in 1 hour (almost)
XPages Extension Library - Create an app in 1 hour (almost)
 
jQuery basics for Beginners
jQuery basics for BeginnersjQuery basics for Beginners
jQuery basics for Beginners
 
Java script
Java scriptJava script
Java script
 
symfony & jQuery (phpDay)
symfony & jQuery (phpDay)symfony & jQuery (phpDay)
symfony & jQuery (phpDay)
 
Laravel the right way
Laravel   the right wayLaravel   the right way
Laravel the right way
 
Broadleaf Presents Thymeleaf
Broadleaf Presents ThymeleafBroadleaf Presents Thymeleaf
Broadleaf Presents Thymeleaf
 
HTML Forms
HTML FormsHTML Forms
HTML Forms
 
Advanced Interfaces and Repositories in Laravel
Advanced Interfaces and Repositories in LaravelAdvanced Interfaces and Repositories in Laravel
Advanced Interfaces and Repositories in Laravel
 
CGI::Prototype (NPW 2006)
CGI::Prototype (NPW 2006)CGI::Prototype (NPW 2006)
CGI::Prototype (NPW 2006)
 

Similar to Java script frame history

Java script frame window
Java script frame windowJava script frame window
Java script frame window
H K
 
Introduction to Html5
Introduction to Html5Introduction to Html5
Introduction to Html5
www.netgains.org
 
jQuery
jQueryjQuery
Javascript 2
Javascript 2Javascript 2
Javascript 2
pavishkumarsingh
 
Devoxx 2014-webComponents
Devoxx 2014-webComponentsDevoxx 2014-webComponents
Devoxx 2014-webComponents
Cyril Balit
 
lect4
lect4lect4
lect4
lect4lect4
Client Web
Client WebClient Web
Client Web
Markiyan Matsekh
 
Unit3.pptx
Unit3.pptxUnit3.pptx
Unit3.pptx
AnamikaRai59
 
Wt unit 5
Wt unit 5Wt unit 5
Wt unit 5
team11vgnt
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQuery
Seble Nigussie
 
Nagios Conference 2014 - Troy Lea - JavaScript and jQuery - Nagios XI Tips, T...
Nagios Conference 2014 - Troy Lea - JavaScript and jQuery - Nagios XI Tips, T...Nagios Conference 2014 - Troy Lea - JavaScript and jQuery - Nagios XI Tips, T...
Nagios Conference 2014 - Troy Lea - JavaScript and jQuery - Nagios XI Tips, T...
Nagios
 
Unit – II (1).pptx
Unit – II (1).pptxUnit – II (1).pptx
Unit – II (1).pptx
DrDhivyaaCRAssistant
 
J query training
J query trainingJ query training
Html5 For Jjugccc2009fall
Html5 For Jjugccc2009fallHtml5 For Jjugccc2009fall
Html5 For Jjugccc2009fall
Shumpei Shiraishi
 
Django crush course
Django crush course Django crush course
Django crush course
Mohammed El Rafie Tarabay
 
Jquery
JqueryJquery
HTML5 New and Improved
HTML5   New and ImprovedHTML5   New and Improved
HTML5 New and Improved
Timothy Fisher
 
Basics of Java Script (JS)
Basics of Java Script (JS)Basics of Java Script (JS)
Basics of Java Script (JS)
Ajay Khatri
 
HTML5 and the dawn of rich mobile web applications pt 2
HTML5 and the dawn of rich mobile web applications pt 2HTML5 and the dawn of rich mobile web applications pt 2
HTML5 and the dawn of rich mobile web applications pt 2
James Pearce
 

Similar to Java script frame history (20)

Java script frame window
Java script frame windowJava script frame window
Java script frame window
 
Introduction to Html5
Introduction to Html5Introduction to Html5
Introduction to Html5
 
jQuery
jQueryjQuery
jQuery
 
Javascript 2
Javascript 2Javascript 2
Javascript 2
 
Devoxx 2014-webComponents
Devoxx 2014-webComponentsDevoxx 2014-webComponents
Devoxx 2014-webComponents
 
lect4
lect4lect4
lect4
 
lect4
lect4lect4
lect4
 
Client Web
Client WebClient Web
Client Web
 
Unit3.pptx
Unit3.pptxUnit3.pptx
Unit3.pptx
 
Wt unit 5
Wt unit 5Wt unit 5
Wt unit 5
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQuery
 
Nagios Conference 2014 - Troy Lea - JavaScript and jQuery - Nagios XI Tips, T...
Nagios Conference 2014 - Troy Lea - JavaScript and jQuery - Nagios XI Tips, T...Nagios Conference 2014 - Troy Lea - JavaScript and jQuery - Nagios XI Tips, T...
Nagios Conference 2014 - Troy Lea - JavaScript and jQuery - Nagios XI Tips, T...
 
Unit – II (1).pptx
Unit – II (1).pptxUnit – II (1).pptx
Unit – II (1).pptx
 
J query training
J query trainingJ query training
J query training
 
Html5 For Jjugccc2009fall
Html5 For Jjugccc2009fallHtml5 For Jjugccc2009fall
Html5 For Jjugccc2009fall
 
Django crush course
Django crush course Django crush course
Django crush course
 
Jquery
JqueryJquery
Jquery
 
HTML5 New and Improved
HTML5   New and ImprovedHTML5   New and Improved
HTML5 New and Improved
 
Basics of Java Script (JS)
Basics of Java Script (JS)Basics of Java Script (JS)
Basics of Java Script (JS)
 
HTML5 and the dawn of rich mobile web applications pt 2
HTML5 and the dawn of rich mobile web applications pt 2HTML5 and the dawn of rich mobile web applications pt 2
HTML5 and the dawn of rich mobile web applications pt 2
 

More from H K

Assignment4
Assignment4Assignment4
Assignment4
H K
 
Assignment3
Assignment3Assignment3
Assignment3
H K
 
Induction
InductionInduction
Induction
H K
 
Solution3
Solution3Solution3
Solution3
H K
 
Solution2
Solution2Solution2
Solution2
H K
 
Mid-
Mid-Mid-
Mid-
H K
 
Assignment4
Assignment4Assignment4
Assignment4
H K
 
Assignment4
Assignment4Assignment4
Assignment4
H K
 
Dm assignment3
Dm assignment3Dm assignment3
Dm assignment3
H K
 
Proof
ProofProof
Proof
H K
 
Resolution
ResolutionResolution
Resolution
H K
 
Assignment description
Assignment descriptionAssignment description
Assignment description
H K
 
Dm assignment2
Dm assignment2Dm assignment2
Dm assignment2
H K
 
Set
SetSet
Set
H K
 
Dm assignment1
Dm assignment1Dm assignment1
Dm assignment1
H K
 
Logic
LogicLogic
Logic
H K
 
Introduction
IntroductionIntroduction
Introduction
H K
 
Assignment 2 sol
Assignment 2 solAssignment 2 sol
Assignment 2 sol
H K
 
Assignment sw solution
Assignment sw solutionAssignment sw solution
Assignment sw solution
H K
 
Violinphoenix
ViolinphoenixViolinphoenix
Violinphoenix
H K
 

More from H K (20)

Assignment4
Assignment4Assignment4
Assignment4
 
Assignment3
Assignment3Assignment3
Assignment3
 
Induction
InductionInduction
Induction
 
Solution3
Solution3Solution3
Solution3
 
Solution2
Solution2Solution2
Solution2
 
Mid-
Mid-Mid-
Mid-
 
Assignment4
Assignment4Assignment4
Assignment4
 
Assignment4
Assignment4Assignment4
Assignment4
 
Dm assignment3
Dm assignment3Dm assignment3
Dm assignment3
 
Proof
ProofProof
Proof
 
Resolution
ResolutionResolution
Resolution
 
Assignment description
Assignment descriptionAssignment description
Assignment description
 
Dm assignment2
Dm assignment2Dm assignment2
Dm assignment2
 
Set
SetSet
Set
 
Dm assignment1
Dm assignment1Dm assignment1
Dm assignment1
 
Logic
LogicLogic
Logic
 
Introduction
IntroductionIntroduction
Introduction
 
Assignment 2 sol
Assignment 2 solAssignment 2 sol
Assignment 2 sol
 
Assignment sw solution
Assignment sw solutionAssignment sw solution
Assignment sw solution
 
Violinphoenix
ViolinphoenixViolinphoenix
Violinphoenix
 

Recently uploaded

Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPLAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
RAHUL
 
Life upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for studentLife upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for student
NgcHiNguyn25
 
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptxPrésentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
siemaillard
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
Israel Genealogy Research Association
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
Dr. Mulla Adam Ali
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
Nicholas Montgomery
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
Priyankaranawat4
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
AyyanKhan40
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Excellence Foundation for South Sudan
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
Celine George
 
How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
Celine George
 
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
Nguyen Thanh Tu Collection
 
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptxPengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Fajar Baskoro
 
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem studentsRHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
Himanshu Rai
 
Cognitive Development Adolescence Psychology
Cognitive Development Adolescence PsychologyCognitive Development Adolescence Psychology
Cognitive Development Adolescence Psychology
paigestewart1632
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
eBook.com.bd (প্রয়োজনীয় বাংলা বই)
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
Colégio Santa Teresinha
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
Academy of Science of South Africa
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
Celine George
 

Recently uploaded (20)

Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
 
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPLAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
 
Life upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for studentLife upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for student
 
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptxPrésentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
 
How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
 
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
 
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptxPengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptx
 
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem studentsRHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
 
Cognitive Development Adolescence Psychology
Cognitive Development Adolescence PsychologyCognitive Development Adolescence Psychology
Cognitive Development Adolescence Psychology
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
 

Java script frame history

  • 1. Lecture 20 Referring to Unnamed Frames Numerically This is the last topic with using Frames in JavaScript. Like we did with Forms, same is the case with Frames. If we don’t give any name to forms, then in JavaScript first form is referred as forms [0], second form is referred as forms [1]. This is because; JavaScript maintains an array of all the forms. Similarly, if frames are unnamed, i.e. we don’t give any name to frames, then in JavaScript first frame is referred as frames [0], second frame is referred as frames [1], and so on. Let us take an example. Below is the code for frameset.html <HTML> <frameset cols="50%,50%"> <frame src="frame1.html"> <frame src="frame2.html"> </frameset> </HTML> Below is the code for frame1.hmtl <HTML> <HEAD> <TITLE> Frame 1</TITLE> <script language="JavaScript"> function fn1() { window.alert("This is function in frame 1"); } </script> </HEAD> <BODY> This is frame 1 <br> <a href="#" onClick="parent.frames[1].fn1()"> Call Function in Frame2</a> </BODY> </HTML> Below is the code for frame2.html <HTML> <HEAD> <TITLE> Frame 2</TITLE> <script language="JavaScript"> function fn1() {
  • 2. window.alert("This is function in frame 2"); } </script> </HEAD> <BODY> This is frame 2 <br> <a href="#" onClick="parent.frames[0].fn1()"> Call Function in Frame1</a> </BODY> </HTML> History Object History Object Properties • Length: Returns the number of items in the current history list History Object Methods • Back(): Moves back n items in the history list • Forward(): Moves forward n items in the history list • Go(): Moves to item n in the history list There are currently no History object events. This means you cannot associate any event with the History object. History object contains the list of URL’s that your browser has visited. In other words, History object is an array of all URL’s visited so far with the current open browser. Since History object is an array, so it must have a length property, which will give you the number of URL visited so far. Generally, if you want to go back to the previous page, you click the back button in the menu bar of your browser. And, in case you want to go back to the next page, you click the forward button Notice: When you open a browser, back and forward button both are disabled. If you want, you can provide that buttons on your web page, so that user can move back and forward using your buttons rather than using browser buttons. There are three ways to implement back and forward buttons
  • 3. 1. Back and Forward Using History 2. Back and Forward Buttons (Simple) 3. Back and Forward Buttons Without History Back and Forward Using History Now, we will understand How to code back and forward button using history. Below is the code <HTML> <HEAD> <TITLE> New Document </TITLE> <script LANGUAGE="JavaScript"> function back() { history.go(-1); } function forward() { history.go(+1); } </script> </HEAD> <BODY> <FORM> <INPUT TYPE="button" VALUE="<< Back" onClick="back()"> <INPUT TYPE="button" VALUE="Forward >>" onClick="forward()"> </FORM> </BODY> </HTML> Back and Forward Button (Simplest Way) <HTML> <HEAD> <TITLE> New Document </TITLE> <script LANGUAGE="JavaScript"> function back() { Location.href=”a.html”; } function forward() { Location.href=”b.html”
  • 4. } </script> </HEAD> <BODY> <INPUT TYPE="button" VALUE="<< Back" onClick="back()"> <INPUT TYPE="button" VALUE="Forward >>" onClick="forward()"> </BODY> </HTML> Back and Forward buttons without using history object <script language="JavaScript"> var MyLocation=window.location; var MyPage=new Array; { MyPage[0]="index.html"; MyPage[1]="alerts.htm"; MyPage[2]="alertsText.htm"; MyPage[3]="alertsImages.htm"; MyPage[4]="jumpfunction.htm"; MyPage[5]="alertConfirm.htm"; MyPage[6]="alertConfirm2Locs.htm"; MyPage[7]="alertOnLoad.htm"; MyPage[8]="alertHelloEx.htm"; MyPage[9]="alertPrompts.htm"; MyPage[10]="documentWrite.htm"; MyPage[11]="documentWrite2.htm";
  • 5. MyPage[12]="WindowNew.htm"; MyPage[13]="WindowNew2.htm"; MyPage[14]="WindowNewHyperlinks.htm"; MyPage[15]="menu1.htm"; MyPage[16]="menuSelectOnChange.htm"; MyPage[17]="ArrayText.htm"; MyPage[18]="jsFrames.htm"; MyPage[19]="frameHyperlinks.htm"; MyPage[20]="BackForward.htm"; } function GoBack() { if (ThisPageNumber <=0) { alert("You are at the beginning of this series"); } else{ ThisPageNumber=ThisPageNumber-1; window.location=MyPage[ThisPageNumber]; }} function GoForward(){ ThisPageNumber=ThisPageNumber+1; if (ThisPageNumber >=MyPage.length) { answer=confirm("You are at the end of the present series. "+ "Press ok to go to the beginning. Cancel to stay here"); if (answer!=0) {