JavaScript
  Home arrow JavaScript arrow Page 2 - Principles of Active Client Pages: the Scr...
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

Principles of Active Client Pages: the Script Approach
By: Chrysanthus Forcha
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2009-06-12

    Table of Contents:
  • Principles of Active Client Pages: the Script Approach
  • Source Code
  • String Content
  • Principles of the Script Approach

  • 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


    Principles of Active Client Pages: the Script Approach - Source Code


    (Page 2 of 4 )

    The source code for the file of the frame is:

     

    <html>

     

    <script type="text/javascript">

    document.write(parent.theArray[parent.pInx])

    </script>

     

    </html>

     

    Yes, it is very short. It has to be like that, since we always have to be changing all (or almost all) of its content. Its initial content is downloaded with the frameset, as a string value of the first element of the array.

    For the frame file, you have just the start and end HTML tags, and a little JavaScript. All that the script does is write into the document (page) the value of an element in the array of the frameset script. It uses the expression "document.write()," which generally replaces all the content of the page. The argument for this expression is

     

    parent.theArray[parent.pInx]

     

    The parent here refers to the frameset. This is followed by a dot, then the array in the frameset script. The index of the array object here is

     

    parent.pInx

     

    Remember that pInx is a variable in the frameset script. The value of this variable is an integer, which can be changed by script. The integer is always an index of the array. So to access it from the frame, just as to access the array from the frame, you need to begin with "parent" followed by a dot. So the value of pInx determines the page that we see.

    More JavaScript Articles
    More By Chrysanthus Forcha


     

    JAVASCRIPT ARTICLES

    - Comparing Fields and Customizing Error Messa...
    - Checking Numbers and File Extensions with jQ...
    - Validating Digits and Dates with jQuery`s Va...
    - Validating Ranges, Emails, and URLs with jQu...
    - More Uses for the jQuery Tooltip Plug-in`s b...
    - Building Image-Based Tooltips with the jQuer...
    - Using the jQuery Tooltip Plug-in`s bodyHandl...
    - Using Rangelength, Min and Max with the Vali...
    - Using Minlength and Maxlength with the Valid...
    - Modifying Tooltip Coordinates with the jQuer...
    - Applying a Fade Out Effect with the jQuery T...
    - Tracking Mouse Movements with the jQuery Too...
    - Checking Online Forms with the Validator jQu...
    - Nested JavaScript Functions as Objects
    - The jQuery Tooltip Plug-in







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek