Home arrow HTML arrow Page 2 - Testing Browser Response to Active Client Pages
HTML

Testing Browser Response to Active Client Pages


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.

Author Info:
By: Chrysanthus Forcha
Rating: 5 stars5 stars5 stars5 stars5 stars / 2
September 22, 2009
TABLE OF CONTENTS:
  1. · Testing Browser Response to Active Client Pages
  2. · Level 4
  3. · Features in the Example We Use in the Assessment of Browsers
  4. · Description of the Pages

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
Testing Browser Response to Active Client Pages - Level 4
(Page 2 of 4 )

There is only one window at level 4. This window is produced by Doc1, which is the second document in a window at level 3. This window at level 4 is produced when you click a button in Doc1. The content of this window is in a file called sendWinPge4Str.pl in the server. This is the content of the file:

$returnStr = qq{

<html>

<head>

<script type="text/javascript">

function showValueIn3_1()

{

alert(window.opener.var3_1);

}

</script>

</head>

<body>

This is page 4 win<br />

<button type="button" onclick="showValueIn3_1()">Show the Value in Page 3_1</button>

</body>

</html>

};


print $returnStr;

There are two Perl statements in the file, as in the others. The quote operator has an HTML document. Remember that each window in this example has at least one HTML document. There is actually only one window in this example that has more than one HTML document; it has two HTML documents. The window here has one HTML document.

The HEAD element of the window here has a JavaScript. This JavaScript has one function, called showValueIn3_1(). There is a button in the BODY element. When this button is clicked, the showValueIn3_1() function is called. This function has an alert() statement. The alert() statement displays the value of the var3_1 variable residing in Doc1. This value is "I am 3_1." The argument of the alert function is:

window.opener.var3_1

In this expression, window represents the present window. Opener is a reference to the window that opened the present window. Var3_1 is a JavaScript variable in the opener window. When the showValueIn3_1() function is called, the value of the var3_1 variable is displayed.

Again, this sounds good; however, for ACP programming today, I do not advise 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.

Let us look at what is in the BODY element. All you have in the BODY element is some text, a line break element and a button. When this button is clicked, the  showValueIn3_1() function is called.

That finishes the explanation of the complete code. I described the Simple Example in part 1 of the series; I have used part 2 and 3 to explain the complete code. Now that you understand the example including its coding, you are in a good position for a technical assessment of the response of browsers to ACP.


blog comments powered by Disqus
HTML ARTICLES

- HTML5 Boilerplate: Working with jQuery and M...
- HTML5 Boilerplate Introduction
- New API Platform for HTML5
- BBC Adopts HTML 5, Mozilla Addresses Issues
- Advanced Sticky Footers in HTML and CSS
- HTML and CSS Sticky Footers
- Strategy Analytics Predicts HTML5 Phones to ...
- HTML5 Guidelines for Web Developers
- Learning HTML5 Game Programming
- More Engaging CSS3 and HTML Background Effec...
- Engaging HTML and CSS3 Background Effects
- More Web Columns with CSS3 and HTML
- Columns with CSS3 and HTML
- Creating Inline-Block HTML Elements with CSS
- Drag and Drop in HTML5: Parsing Local Files

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



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