XHTML DOM usage w/ Javascript
Hi, I'm new to this forum and pretty much all of web design. I have a website that is using XHTML 1.1. I want to have one basic site template and have javascript add xml content into it.
Unfortunately, because of the lack of document.write, I haven't been able to figure out how to load the xml data I want and place it into an xhtml file. I have been trying to change the title, but I haven't had any luck. Same with paragraphs. My browsers is Safari Beta 4, and Firefox 3.
I have tried:
content=document.implementation.createDocument("", "",null);
content.async="false";
content.load("home.xml");
page=document.implementation.createDocument("","", null);
page.async="false";
page.load("site.xhtml");
var title;
title = content.getElementsByTagName("title")[0].childnodes[0].nodeValue ;
and
this one was just a test on adding text
var newtext = document.createTextNode(" Some text added dynamically. ");
var para = document.getElementById("p1");
para.appendChild(newtext);
Any help would be appreciated.
Thanks in advance.
-Cuervo
|