JavaScript
  Home arrow JavaScript arrow The Script Approach to Active Client Pages...
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

The Script Approach to Active Client Pages: Chrys`s Enhancement
By: Chrysanthus Forcha
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 3 stars3 stars3 stars3 stars3 stars / 2
    2009-06-19

    Table of Contents:
  • The Script Approach to Active Client Pages: Chrys`s Enhancement
  • Script Approach Without Frameset
  • The innerHTML Property
  • Summary of ACP

  • 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


    The Script Approach to Active Client Pages: Chrys`s Enhancement


    (Page 1 of 4 )

    In this conclusion to a three-part series on active client pages, I give you my enhancements to the Script Approach. I am the one who came up with the Script Approach. I derived it from Vlad’s work. Before I start my enhancements, let me talk about the store and Vlad’s Fake Get Method. Vlad himself calls one of his methods the Fake Get Method.

    The Store

    Active Client Pages Technology needs a store. With this approach, the store is the frameset (parent). Data is stored in variables or object properties or arrays in the JavaScript of the frameset. The pages come and go, but data for the different pages can remain in the frameset.

    Vlad's Fake Get

    Instead of using the frameset to retrieve data as I have shown, you can use what Vlad calls the Fake Get Method. I have not yet read anything about this method, so I will not comment on it in this series.

    My Enhancements

    Images

    Images take a longer time to download than text. If you have been using web picture galleries, you must have noticed that, when you click a link to see an image (enlarged form), it takes time for you to see the image. As of today, only the first image (or first set of images) may take time if you use ACP technology.

    Let us say that you have a web page, with or without a frameset. You want this page to be able to display 30 images, one at a time, in a particular area. Design your page such that the first image will be in that area. Let this area be a table cell. With some designs, it can be a DIV element (see below) or some containing element. Give the table cell definite dimensions. The first image tag of the table cell should be something like this:

    <img id='I1' src='image1.gif' style='display:block'>

    Note that the value of the style attribute is 'display:block', meaning that the image has to be displayed.

    As for the other images you should have something like the following at the bottom of the BODY element.


    <img id='I1' src='image1.gif' style='display:none'>

    <img id='I2' src='image2.gif' style='display:none'>

    <img id='I3' src='image3.gif' style='display:none'>

    ............


    The value of the display property of each of these image tags is "none." In this way, when they are fully downloaded, they will not appear on the page and will not occupy space. While these images are being downloaded, the user will see the first image; you have designed your page in such a way that it is rendered by the browser as it arrives. From the user's point of view, this first image can take a long time to appear on the screen. The other images will not take long to appear on the screen, because they have been downloaded in advance.

    You can have a button on the page, which, when clicked, replaces the image in the area by one of these images at the bottom. I normally use the table cell innerHTML property for this replacement. Note that the first image is also among the images at the bottom. Before you replace it, you have to change the value of its display property to "none." The image replacing it should have the value of its display property set to "block." In this way you can change the images in the area, with no speed problems after the first one has been displayed.

    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 3 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek