Home arrow JavaScript arrow Page 4 - A Simple Document Phase Example of Active Client Pages
JAVASCRIPT

A Simple Document Phase Example of Active Client Pages


In this fifth part of a twelve-part series on Active Client Pages, we look at a simple example illustrating the Document Phase of Chrys’s Approach. You need good knowledge in HTML and JavaScript to understand this part of the series.

Author Info:
By: Chrysanthus Forcha
Rating: 5 stars5 stars5 stars5 stars5 stars / 5
July 31, 2009
TABLE OF CONTENTS:
  1. · A Simple Document Phase Example of Active Client Pages
  2. · The Master Page Code
  3. · The JavaScript Segment
  4. · Function to Develop and Load the Second Page Code Segment

print this article
SEARCH DEVARTICLES

A Simple Document Phase Example of Active Client Pages - Function to Develop and Load the Second Page Code Segment
(Page 4 of 4 )

This is the last sub code segment in the JavaScript:


function loadSecondPage()

{

var pageTwo = document.open();

pageTwo.write(page2Doc);

pageTwo.close();

 

//copy(move) the store

pageTwo.getElementById('S2').rows[0].cells[0].innerHTML = firstName;

pageTwo.getElementById('S2').rows[1].cells[0].innerHTML = lastName;

 

//give the values of the input text elements

pageTwo.getElementById('I21').value = firstName;

pageTwo.getElementById('I22').value = lastName;

}


When the button on the master page is clicked, this function is called. Let us go though the lines of the function. The first line opens an output stream for writing. Whatever will be written will constitute the next page. The second line in the function writes all the content of the next page. The third line in the function closes the output stream, and by doing so, establishes the next page. After this third line you should see the new page.

The next two statements transfer the store to an HTML table element whose value for the display property is “none.” The following two statements give values to two Input Text elements in the new page. Remember that the new page with these two Input Text elements has already been loaded at the beginning of this function. We shall look at the content of the second page in the next part of the series.

Let us take a break here and continue in the next part.


DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

blog comments powered by Disqus
JAVASCRIPT ARTICLES

- Project Nashorn to Make Java, JavaScript Wor...
- JavaScript Virus Attacks Tumblr Blogs
- Google Releases Stable Dart Version, JavaScr...
- Khan Academy Unveils New JavaScript Learning...
- Accessing Nitro? There`s an App for That
- JQuery 2.0 Leaving Older IE Versions Behind
- Fastest JavaScript Engine Might Surprise You
- Microsoft Adjusting Chakra for IE 10
- Brendan Eich: We Don`t Need Google Native Cl...
- An Overview of JavaScript Statements
- An Overview of JavaScript Operators
- Overview of JavaScript Variables
- More of the Top jQuery Social Plugins
- The Top jQuery Social Plugins
- More of the Top jQuery Slider Plugins

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