Justus Beek

Navigation

Skip navigation.

Search

Site navigation

Email conversation

FromJustus Beek
ToMe
SubjectDynamic changing of <DIV> content using perl
Date14 October 2004 17:03
Hi,
 
My question is as follows:

I have a single HTML page containing several <DIV> elements. I know how to
change the content of these elements on the run by using '.innerHTML'. 

I also have a perl script that generates HTML. This generated HTML should
be inserted into one of the <DIV> elements, without having to reload the
whole page. So somehow I want to link the result from my perl script to the
.innerHTML of one of the <DIV> elements. This can be done by using frames
and <A HREF='' target=''> instead of <DIV>, but I prefer not to use frames.

Is this possible and if so, how?

You would make me a very happy man if you could help me with this!

Kind regards,
Justus
FromMe
ToJustus Beek
SubjectRe: Dynamic changing of <DIV> content using perl
Date15 October 2004 8:16
Justus,

There are a few ways to do this. All involve loading the data, and then
using:
document.getElementById('divID').innerHTML = theNewContent;

To load the data you can use frames (which you do not want to do), iframes
(recommended), XML files or embedding new script files (not recommended).

I have details of the various techniques on these two pages:
http://www.howtocreate.co.uk/loadingExternalData.html
http://www.howtocreate.co.uk/tutorials/jsexamples/importingXML.html


Mark 'Tarquin' Wilton-Jones - author of http://www.howtocreate.co.uk/
FromJustus Beek
ToMe
SubjectRe: Dynamic changing of <DIV> content using perl
Date15 October 2004 8:48
Thanks Mark,

I was thinking in the same direction, but now I know for sure this is the 
way to go!

Iframes it will be.

Justus
This site was created by Mark "Tarquin" Wilton-Jones.
Don't click this link unless you want to be banned from our site.