JavaScript
  Home arrow JavaScript arrow Working with IFRAME in JavaScript
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
JAVASCRIPT

Working with IFRAME in JavaScript
By: Jagadish Chaterjee
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 112
    2006-03-01

    Table of Contents:
  • Working with IFRAME in JavaScript
  • How to open a dynamic page in IFRAME using JavaScript
  • How to open a dynamic page in IFRAME using JavaScript: discussion
  • How to write content dynamically into IFRAME using JavaScript
  • How to write content dynamically into IFRAME using JavaScript: discussion
  • How to write content dynamically into IFRAME using JavaScript: another way

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Working with IFRAME in JavaScript


    (Page 1 of 6 )

    This article starts by explaining the differences between FRAME, FRAMESET, and IFRAME and concludes with the concept of using JavaScript with IFRAME.

    All of the examples in this article can be directly tested, by simply copying and pasting the entire code of each section into any text file, saving it with the extension .HTM, and opening it using a browser.

    What are FRAME, FRAMESET and IFRAME?

    Every web designer would generally know what a FRAME (or FRAMESET) on a web page does.  It simply maintains its own content without having any relation to other FRAMES. 

    A web page may be divided into several blocks using FRAMES.  Every FRAME is generally assigned its own web page.  The beauty of the FRAME is that it would never refresh unnecessarily for every post back of the web page. Only the FRAME on which the user is working gets refreshed, not the others.

    To work with FRAME, we need to define FRAMESET.  The FRAMESET internally contains FRAMEs divided logically based on necessity.  Not every browser supports FRAMEs, but the majority of browsers do.

    What about IFRAME?  Another word for IFRAME is “Inline FRAME.”  It is treated as a part of the web page (and not a web page part of FRAME, as in the previous case).  The IFRAME is a small block on our web page which can be treated as a “nested browser” within our web page.  This feature opens the door for displaying/showing other web pages as a part of our web page.  But again a word of caution, not every browser supports it yet.

    An IFRAME is very useful when we want to display the content from other web sites.  We can also write some information (probably HTML) to IFRAME dynamically, treating it as a dynamic page itself.  And another wonderful use of IFRAME is that we can use it for generating dynamic pull-down menus (or even horizontal menus), as it always stays ahead of any windowed control (like a dropdown list) on a web page.  And finally we can use it for wonderful customized tool tips.  To be frank, there are a lot more uses for IFRAMEs.

    A simple usage of an IFRAME would be as follows:

    <iframe  id="Iframe1"  frameborder="0"  vspace="0"  hspace="0"  marginwidth="0"  marginheight="0" width="100"  scrolling="yes"  height="100"  src="http://www.yahoo.com">

    </iframe>

    More JavaScript Articles
    More By Jagadish Chaterjee


       · Hai, want to work with IFRAME? here is a simple article on that. any doubts you...
       · Hello ,I am Riddhi Bhavsar.I am a Web Developer.And I am a beginner for...
       · how can i write content to the iframe if it has an src valuelike <iframe...
       · Is it possible to use iFrame to read a simple text file? I have some code for...
     

    JAVASCRIPT ARTICLES

    - Building Dynamic Shadows with JavaScript and...
    - Active Client Pages: Chrys`s Approach
    - The Script Approach to Active Client Pages: ...
    - Principles of Active Client Pages: the Scrip...
    - Active Client Pages: the Script Approach
    - Building an RTF-capable Form with the Ext JS...
    - Creating a Multi-Tabbed Online Form with the...
    - jQuery Overview
    - Constructing a Multi-Column Online Form with...
    - Grouping Field Sets on Dynamic Web Forms wit...
    - Building Dynamic Web Forms with the Ext JS F...
    - More on JavaScript Array Objects
    - Methods of the DOM Location Object
    - The DOM Location Object Properties
    - Handling Remote Files with JavaScript Click ...







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
    Stay green...Green IT