HTML
  Home arrow HTML arrow Testing Browser Response to Active Client ...
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? 
HTML

Testing Browser Response to Active Client Pages
By: Chrysanthus Forcha
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 2
    2009-09-22

    Table of Contents:
  • Testing Browser Response to Active Client Pages
  • Level 4
  • Features in the Example We Use in the Assessment of Browsers
  • Description of the Pages

  • 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


    Testing Browser Response to Active Client Pages


    (Page 1 of 4 )

    Welcome to the fourth part of a five-part series that shows how browsers respond to Active Client Pages. In this part, we complete the code for the simple example to be used to test the response of browsers to Active Client Pages, and then we look at the features in the example that we shall use to assess the browsers.

    Features of the ACP example used to access Browsers

    Doc1

    Doc1 is loaded by Doc0 when you click the button in Doc0. Doc1 content resides in a file called sendPge3Doc1Str.pl at the server. This is the file:

    $returnStr = qq{

    <html>

    <head>

    <script type="text/javascript">

    var var3_2 = "I am 3_2";


    function showValueIn2_2()

    {

    alert(window.opener.storeVar2_2);

    }

    function openWin4()

    {

    win4 = window.open("","page4win","width=400,height=400");

    win4.document.write(page4Win);

    }

    </script>

    </head>

    <body>

    This is page 3 (win)<br />

    <button type="button" onclick="showValueIn2_2()">Show the Value in Page 2_2</button>

    <button type="button" onclick="openWin4()">Open a Page 4</button>


    <script type="text/javascript">

    //content of page 3 Doc1

    var page4win = "";

     

    //Ajax code to download next window

    </script>

    </body>

    </html>

    };


    print $returnStr;

    This is a Perl file with two Perl statements like the others. The quote operator has an HTML document. The HEAD element has a JavaScript that has two functions. The names of these functions are showValueIn2_2() and openWin4().

    There are two functions in the BODY element. When you click one of the buttons, the showValueIn2_2() function will be called. This function displays the value of the JavaScript variable named storeVar2_2 in the window at level 2 (on the right in fig 3.1). This window is the opener (parent) to the window having Doc0 and Doc1. So the opener (parent window for Doc1) is this window (at level 2).

    Let us look at what is inside the showValueIn2_2() function. You have just one statement inside the function; it is an alert statement. The following expression is the argument of the alert call:

    window.opener.storeVar2_2

    In this expression, window represents the present window (which has the two documents). Opener is a reference to the window that opened the present window. StoreVar2_2 is a JavaScript variable in the opener window. When the showValueIn2_2() function is called, the value of the storeVar2_2 variable is displayed.

    This sounds good; however, for ACP programming today, I do not advice you to make calls from the document phase into the window phase and vice-versa. I will explain why in the next part of the series.

    The openWin4() function opens a window. This window is at the fourth level in the tree in fig 3.1. The statements inside the function are normal statements for producing a window. The statements for producing a window are the same independent of whether you are producing the window from another window or a document. Likewise, the statements for producing a document are the same independent of whether you are producing the document from another document or a window. However, the statements for producing a document are not exactly the same as those for producing a window.

    Let us look at what is in the BODY element. You have some text, a line break element, two buttons and a JavaScript. Each of these buttons has a corresponding function in the HEAD element.

    Let us look at what is in the JavaScript. The first statement is the declaration of the page4win variable, which will hold the content of the next window in string form. Then you have the Ajax code which downloads the content of the next window. After downloading the content, it is assigned to the page4win variable. The value of this variable will be used by the openWin4() function only when you want to open the next window.

    More HTML Articles
    More By Chrysanthus Forcha


     

    HTML ARTICLES

    - Comparing Browser Response to Active Client ...
    - Testing Browser Response to Active Client Pa...
    - Active Client Pages: Completing the Code for...
    - ACP and Browsers: Setting up an Example
    - How Browsers Respond to Active Client Pages
    - Completing a Tree with Active Client Pages
    - HTML Form Verification and ACP
    - Building an ACP Tree
    - Completing an ACP 3D HTML Table Image Gallery
    - Building an ACP 3D HTML Table Image Gallery
    - A Multiple Page Image Gallery with Active Cl...
    - Building an Image Gallery with Active Client...
    - Concluding a Menu for All Browsers
    - A Vertical Menu for All Browsers
    - Downloading Long HTML Pages with ACP







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