WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDESPHP CLASSESCODE SEARCHARTICLES SEARCHPHP FORUMSPHP MANUALPHP FUNCTIONS LISTWEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Join us on FaceBook
Submit a code Example / Snippet Submit Your Code
Poker Tournaments Poker Tournaments
Poker Guide for Developers Poker Guide for Developers
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Resources
Web Development Content
Internet Security Software
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
פרייסז - הכח לקנות עובר לידיים שלך
Texas Holdem Poker Evangelists

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : Using innerHTML In Order To Copy Content From One Page To Another
Categories : HTML, Java Script Update Picture
Amir Vaknin
Date : Jul 10th 2003
Grade : 4 of 5 (graded 5 times)
Viewed : 22800
File : 3699.zip
Images : No Images for this code example.
Search : More code by Amir Vaknin
Action : Grade This Code Example
Tools : My Examples List

Submit your own code examples  Submit your own code examples 
 

This example shows how to use the innerHTML Method of the Java Script Language .
with this method we can display content from one page in another .

What is this good for ?

Lets say that we would like to display a clock time which is based on the server and not on the
client and we want the clock time to refresh every X time with out refreshing all of the page .

so all we need to do is to create 2 pages :

The first page is the page that will display the clock and this page should contain a hidden iframe
by setting the width and height to 0 .

The iframe should point to the second page which holds the content that we would like to copy (in
our case is the clock function ) .

so in order to do that we are using a little java script like this in the second page :

<DIV id="ClockSrc">
          <!-- This Is The Text That We Would Like To Copy From This Div To The Other Div . -->
          <H1>here we should put the clock function that we would like to display </H1>
</DIV>

<script>
      // THIS SCRIPT WILL COPY THE CONTENT OF THE ClockSrc DIV INTO THE ClockDiv IN THE UPPER PAGE.
      parent.document.all('ClockDiv').innerHTML = document.all('ClockSrc').innerHTML;
</script>


Please see the attached file for a working example.

good luck



How to get the Focus (Cursor) into a Form-Element.
Categories : HTML, Java Script
Javascript linked dropdowns
Categories : Java Script, HTML, Classes and Objects
Javascript animated menu items
Categories : DHTML, CSS, Java Script, HTML
How to create <SELECT> menues that change on the fly according to other <SELECT> menues on the page?
Categories : Java Script, HTML
Bouncing Marquee at Status Bar
Categories : Java Script, HTML, Browsers
Page Loading Message shown during the time your site's page is being loaded.
Categories : HTML, CSS, Java Script
Check if Javascript is Enabled or Disabled - Works in all Browsers
Categories : Java Script, HTML, Web Browsers
Javascript Background Scroller
Categories : Java Script, CSS, HTML
Prevent Right Mouse steal your graphics
Categories : HTML, Java Script, Security
Clock at Status Bar
Categories : Java Script, HTML, Date Time
complete simply working javascript password generator file. Use letter, vowels, consonants (uppercase and lowercase) arrays to create a really random and secure password. improved security using time functions to initialize random number generator.
Categories : Java Script, HTML, Security, Authentication, Strings
Builds JavaScript that updates the contents of one selector based on another.
Categories : HTML, Java Script, PHP, Complete Programs, General
Table editable dynamic form with edit + selection (select / option) + checkbox.
Categories : Java Script, DHTML, User Interface, CSS, HTML
Mordern Peroidic Table - Science
Categories : Java Script, HTML, Charts and Graphs
Javascript Color Picker
Categories : Java Script, Colors, HTML
 Sarah King wrote :992
this web page is essential reading for anyone using innerHTML

http://www.developer-x.com/content/innerhtml/