18/09/06

Permalink 10:04:54 pm, Categories: Javascript, 117 words   English (AU)

Changing content dynamically.

For some reason I keep finding reasons to want to be able to dynamically
change the content of parts of web pages. And I keep having to remind myself how
to do it. So here it is again. First, the section to be changed has to be
enclosed within a tag, and given a unique ID:

<div id="perm_p" name="perm_p">
</div>

Then, use this javascript code, which is supposed to be cross-browser
compatible:

if(document.layers)
{
   document.layers.perm_p.document.write(perm_code);
}
else
{
   if(document.all)
   {
      document.all.perm_p.innerHTML = perm_code; 
   }
   else
   {
      elid = document.getElementById("perm_p"); 
      elid.title = perm_code; elid.firstChild.data = perm_code;
   }
}
Permalink
Permalink 09:20:46 pm, Categories: Musings on life, 73 words   English (AU)

Starting again ....

"What's on in Craig's head?" At the moment it looks like not much!

Sorry, this seems silly. Unfortunately this domain has moved to yet another server - the fourth in two years. What a pain!! (You can get an idea of some of the reasons for this visiting No More Gunnels.)

As soon as I get some time I will repost some of the previous stuff, and get back into creating some new stuff.

Permalink

Craig's Diary

Craig personal diary. A collection of programming tips and thoughts, and general musings on life, the universe and everything.

December 2008
Mon Tue Wed Thu Fri Sat Sun
<<  <   >  >>
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        

Search

Archives

Linkblog

Misc

Syndicate this blog XML

What is RSS?

powered by
b2evolution