Logo

Navigation
  • Home
  • Services
    • ERP Solutions
    • Implementation Solutions
    • Support and Maintenance Solutions
    • Custom Solutions
    • Upgrade Solutions
    • Training and Mentoring
    • Web Solutions
    • Production Support
    • Architecture Designing
    • Independent Validation and Testing Services
    • Infrastructure Management
  • Expertise
    • Microsoft Development Expertise
    • Mobile Development
    • SQL Server Database and BI
    • SAP BI, SAP Hana, SAP BO
    • Oracle and BI
    • Oracle RAC
  • Technical Training
    • Learn Data Management
      • Business Intelligence
      • Data Mining
      • Data Modeling
      • Data Warehousing
      • Disaster Recovery
    • Learn Concepts
      • Application Development
      • Client Server
      • Cloud Computing Tutorials
      • Cluster Computing
      • CRM Tutorial
      • EDI Tutorials
      • ERP Tutorials
      • NLP
      • OOPS
      • Concepts
      • SOA Tutorial
      • Supply Chain
      • Technology Trends
      • UML
      • Virtualization
      • Web 2.0
    • Learn Java
      • JavaScript Tutorial
      • JSP Tutorials
      • J2EE
    • Learn Microsoft
      • MSAS
      • ASP.NET
      • ASP.NET 2.0
      • C Sharp
      • MS Project Training
      • Silverlight
      • SQL Server 2005
      • VB.NET 2005
    • Learn Networking
      • Networking
      • Wireless
    • Learn Oracle
      • Oracle 10g
      • PL/SQL
      • Oracle 11g Tutorials
      • Oracle 9i
      • Oracle Apps
    • Learn Programming
      • Ajax Tutorial
      • C Language
      • C++ Tutorials
      • CSS Tutorial
      • CSS3 Tutorial
      • JavaScript Tutorial
      • jQuery Tutorial
      • MainFrame
      • PHP Tutorial
      • VBScript Tutorial
      • XML Tutorial
    • Learn Software Testing
      • Software Testing Types
      • SQA
      • Testing
  • Career Training
    • Career Improvement
      • Career Articles
      • Certification Articles
      • Conflict Management
      • Core Skills
      • Decision Making
      • Entrepreneurship
      • Goal Setting
      • Life Skills
      • Performance Development
      • Personal Excellence
      • Personality Development
      • Problem Solving
      • Relationship Management
      • Self Confidence
      • Self Supervision
      • Social Networking
      • Strategic Planning
      • Time Management
    • Education Help
      • Career Tracks
      • Essay Writing
      • Internship Tips
      • Online Education
      • Scholarships
      • Student Loans
    • Managerial Skills
      • Business Communication
      • Business Networking
      • Facilitator Skills
      • Managing Change
      • Marketing Management
      • Meeting Management
      • Process Management
      • Project Management
      • Project Management Life Cycle
      • Project Management Process
      • Project Risk Management
      • Relationship Management
      • Task Management
      • Team Building
      • Virtual Team Management
    • Essential Life Skills
      • Anger Management
      • Anxiety Management
      • Attitude Development
      • Coaching and Mentoring
      • Emotional Intelligence
      • Stress Management
      • Positive Thinking
    • Communication Skills
      • Conversation Skills
      • Cross Culture Competence
      • English Vocabulary
      • Listening Skills
      • Public Speaking Skills
      • Questioning Skills
    • Soft Skills
      • Assertive Skills
      • Influence Skills
      • Leadership Skills
      • Memory Skills
      • People Skills
      • Presentation Skills
    • Finding a Job
      • Etiquette Tips
      • Group Discussions
      • HR Interviews
      • Interview Notes
      • Job Search Tips
      • Resume Tips
      • Sample Resumes
 

JavaScript Frame object

By Exforsys | on May 20, 2007 |
JavaScript Tutorial

JavaScript Frame Object

In this JavaScript tutorial, you will learn about frame object its properties and methods in detail with example. frame object, properties of frame object, frames, self, name, length, parent, methods of frame object, blur(), focus(), setInterval(), clearInterval(), setTimeout(expression, milliseconds), clearTimeout() and events associated with frame object.

Frame Object:

The frame object is a browser object of JavaScript used for accessing HTML frames. The user can use frames array to access all frames within a window. Using the indexing concept, users can access the frames array.

NOTE:

  • The frames array index always starts with zero and not 1.

  • The frame object is actually a child of the window object. These objects are created automatically by the browser and help users to control loading and accessing of frames.

  • The properties and methods of frame object are similar to that of Window object in JavaScript.

  • The frame object does not support close() method that is supported by window object.

  • Using the <FRAMESET> document creates frame objects and each frame created is thus a property of window object.

Properties of frame object:

  • frames
  • name
  • length
  • parent
  • self

frames:

The frames property of frame object denotes a collection or array of frames in a window and also in a frame set.

self:

As the name implies, the self property of frames object denotes the current frame. Using self property, the user can access properties of the current frame window.

name:

The name property of frame object denotes the name of the frame. The method of denoting the name attribute is performed by using the name attribute of the <frame> tag. 

For example it can be written as:


exforsys=window.frames(2).name

The above statement would store the name of the third window frame (as the frames array start with index 0) in a frameset document in the variable exforsys.

length:

The frames array has all the frames present within a window and the length property of the frame object denotes the length of the frames array or gives the number of frames present in a window or a frames array.

parent:

As the name implies, the parent property of frames object denotes the parent frame of the current frame.

Methods of frame object:

  • blur()
  • focus()
  • setInterval()
  • clearInterval()
  • setTimeout(expression, milliseconds)
  • clearTimeout(timeout)

blur():

blur() method of frame object removes focus from the object.

focus():

focus() method of frame object gives focus to the object.

setInterval():

setInterval() method of frame object is used to call a function of JavaScript or to evaluate an expression after the time interval specified in arguments has expired. The time interval in arguments is always specified in milliseconds.

For example:


setInterval=exforsys(test(),2000)

In the above statement, the function test() executes after 2000 milliseconds (2 seconds), specified in the argument.

clearInterval():

clearInterval method of frame object is used to cancel the corresponding defined setInterval method. This is written by referencing the setInterval method using its ID or variable.

General syntax for the method clearInterval() is as below:


clearInterval (Interval_ID)

setTimeout(expression, milliseconds):

setTimeout method of frame object can be used to execute any function, or access any method or property after a specified time interval given to this method as argument.

General syntax for the method setTimeout() is as below:


setTimeout(expression, milliseconds)

For example:


exforsys=setTimeout ("test()", 3000)

The time is always specified in milliseconds and in the above statement, the function test() is called after the specified time of 3000 milliseconds (3 seconds). This is stored in variable named exforsys.

There is confusion about the similarity between setTimeout() method and setInterval() method. The main difference between the two methods is the setInterval method will repeatedly call the referenced function or evaluate the expression until the user leaves the document. In the setTimeout method, the call executes only once after the specified time interval given as argument.

clearTimeout():

clearTimeout method of frame object is used to clear a specified setTimeout method. This is written by referencing the setTimeout method using its ID or variable.

General syntax for the method clearTimeout is as below:


clearTimeout ID_of_setTimeout

For example


clearTimeout exforsys

The above statement clears the setTimeout associated wit the ID named as exforsys, created in the earlier example.

Events associated with frame object:

Though the frame object and frames array have no event handlers associated directly with them, the following event handlers are used to access and control frame objects and frames array:

  • onBlur
  • onFocus
  • OnLoad
  • OnUnLoad
  • « « JavaScript Event Object
    Virtualization Virtual Servers and Virtual Storage » »

Author Description

Avatar

Editorial Team at Exforsys is a team of IT Consulting and Training team led by Chandra Vennapoosa.

Free Training

RSSSubscribe 392 Followers
  • Popular
  • Recent
  • JavaScript Iterative Structures – Part II

    July 27, 2007 - 0 Comment
  • JavaScript Browser Objects

    June 13, 2007 - 0 Comment
  • JavaScript Boolean Object

    June 7, 2007 - 0 Comment
  • How to use JavaScript in HTML page

    April 20, 2007 - 0 Comment
  • JavaScript Document Object Properties

    June 13, 2007 - 0 Comment
  • JavaScript Arrays

    June 7, 2007 - 0 Comment
  • JavaScript Applet Objects

    June 13, 2007 - 0 Comment
  • JavaScript Array Object

    June 6, 2007 - 0 Comment
  • JavaScript Conditional Statements Part 1

    April 24, 2007 - 0 Comment
  • JavaScript Document Object Methods Part I

    August 5, 2007 - 0 Comment
  • JavaScript Objects

    August 12, 2007 - 0 Comment
  • JavaScript String Object

    August 12, 2007 - 0 Comment
  • JavaScript Date Object

    August 12, 2007 - 0 Comment
  • JavaScript Math Object

    August 9, 2007 - 0 Comment
  • JavaScript Windows Object Properties Part II

    August 9, 2007 - 0 Comment
  • JavaScript Windows Object Properties Part I

    August 8, 2007 - 0 Comment
  • JavaScript Window Object Timeout Methods

    August 8, 2007 - 0 Comment
  • JavaScript Document Object Methods Part II

    August 7, 2007 - 0 Comment
  • JavaScript Document Object Methods Part I

    August 5, 2007 - 0 Comment
  • JavaScript History Object Properties and Methods

    August 5, 2007 - 0 Comment

Exforsys e-Newsletter

ebook
 

Related Articles

  • JavaScript Objects
  • JavaScript String Object
  • JavaScript Date Object
  • JavaScript Math Object
  • JavaScript Windows Object Properties Part II

Latest Articles

  • Project Management Techniques
  • Product Development Best Practices
  • Importance of Quality Data Management
  • How to Maximize Quality Assurance
  • Utilizing Effective Quality Assurance Strategies
  • Sitemap
  • Privacy Policy
  • DMCA
  • Trademark Information
  • Contact Us
© 2023. All Rights Reserved.IT Training and Consulting
This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish.AcceptReject Read More
Privacy & Cookies Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Non-necessary
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
SAVE & ACCEPT