Home arrow HTML arrow Page 2 - Active Client Pages: Completing the Code for a Browser Example
HTML

Active Client Pages: Completing the Code for a Browser Example


The aim of this five-part series is to show to what extent a major browser responds to ACP. ACP is a new technology. In order to understand how a browser responds, we need an example to use to test the browser. We need to understand the example first. In this third part of the series I complete the explanation of the example.

Author Info:
By: Chrysanthus Forcha
Rating: 5 stars5 stars5 stars5 stars5 stars / 1
September 15, 2009
TABLE OF CONTENTS:
  1. · Active Client Pages: Completing the Code for a Browser Example
  2. · The sendPge2_2Str.pl File
  3. · Level 3
  4. · The window on the right at Level 3

print this article
SEARCH DEVARTICLES

Active Client Pages: Completing the Code for a Browser Example - The sendPge2_2Str.pl File
(Page 2 of 4 )

This is the file:

$returnStr = qq{

<html>

<head>

<script type="text/javascript">


var storeVar2_2 = "I am 2_2";


function openWin3Doc1()

{

win3D0 = window.open("","page3D0","toolbar=yes,width=400,height=400");

win3D0.document.write(page3Doc0);

}

</script>

</head>

<body>

This is page 2_2 <br />

<button type="button" onclick="openWin3Doc1()">Open Page 3 Doc 0</button>


<script type="text/javascript">


//content of page 3 Doc0

var page3Doc0 = "";

 

//Ajax code to download the next page


</script>

</body>

</html>

};


print $returnStr;

The Head element has a JavaScript. The first statement in the script is a declaration of the storeVar2_2 variable. The value "I am 2_2" is assigned to it. This value will be displayed by the Doc1 document. This document, Doc1 (fig 3.1) is produced by the window of the sendPge2_2Str.pl file. This file has the content of the second window at level 2.

The script has the openWin3Doc1() function. There is a button in the BODY element. When this button is clicked, this function is called. This function opens a new window that houses the two documents.

The first statement of this function opens a window. The next statement writes the content to the window. We want two HTML documents in this window. The content sent is automatically the first document. The next document will be produced in this window by this first document. The page3Doc0 argument holds the initial content of the first window, which is the first document.

Let us look at what is in the BODY element. You have some text, followed by a line break element and a button. This is the button we mentioned above. You have a JavaScript in the BODY element.

The first line of this JavaScript is a declaration of the page3Doc0 variable, which will hold the content of the next window. This variable is the argument of the  openWin3Doc1() function. Next you have the Ajax code, which downloads the content of the next window in advance. It assigns the content as a value to the page3Doc0 variable.

Level 2

Look at the tree of fig.3.1. Level two has two windows. The file for the window on the left is sendPge2_1Str.pl, while that for the window on the right is sendPge2_2Str.pl. We have discussed the contents of these two files.


blog comments powered by Disqus
HTML ARTICLES

- Does HTML5 Need a Main Element?
- Revisiting the HTML5 vs. Native Debate
- HTML5: Not for Phone Apps?
- HTML5 or Native?
- Job Hunting? Freelancer.com Lists This Quart...
- HTML5 in the News
- Report: HTML5 Mobile Performance Lags
- The Top HTML5 Audio Players
- Top HTML5 Video Tutorials
- HTML5: Reasons to Learn and Use It
- More of the Top Tutorials for HTML5 Forms
- MobileAppWizard Releases HTML5 App Builder
- HTML5 Boilerplate: Working with jQuery and M...
- HTML5 Boilerplate Introduction
- New API Platform for HTML5

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials