Loading Xml into an HTML document using JavaScript
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Justin_Ringgold
Posted On:   Monday, September 7, 2009 08:14 PM

Hi, I'm currently working on my portfolio website and would like to have information about my movie clips be retrieved from an XML document when a thumbnail is clicked. I am building my website in HTML and would like to retrieve the Xml using JavaScript. Any help would be appreciated. My XML is valid and structured as such: <?xml version="1.0" encoding="UTF-8"?> <![CDATA[This demo reel is primaraly a collection ......]]> . . . . These are my initial variable definitions and readXML function in javascript: motionNode=workNode.firs   More>>

Hi,


I'm currently working on my portfolio website and would like to have information about my movie clips be retrieved from an XML document when a thumbnail is clicked. I am building my website in HTML and would like to retrieve the Xml using JavaScript. Any help would be appreciated.


My XML is valid and structured as such:


			
<?xml version="1.0" encoding="UTF-8"?>






<![CDATA[This demo reel is primaraly a collection ......]]>


.
.
.
.



These are my initial variable definitions and readXML function in javascript:


			

motionNode=workNode.firstChild;

printNode=motionNode.nextSibling;

fineartNode=printNode.nextSibling;
}
.
.
.
.





A call to function revealText is called "onClick" of a thumbnail as such:



"<(*anchor*) href="videopages/reel.html" class="vid" target="video" onClick="revealText(0)">"



This is function revealText:


 
function revealText(x)
{
var title, project, client, info;

readXMLDocument();

displayNode=motionNode.childNode[x];


titleNode=displayNode.firstChild;


title=titleNode.getAttribute("id");
project=titleNode.getAttribute("project");
client=titleNode.getAttribute("client");
info=titleNode.getNodeValue();

titleSpan.innerHTML=title;
projectSpan.innerHTML=project;
clientSpan.innerHTML=client;
infoSpan.innerHTML=info;
}
]]>



and these are the spans they are written to:


			










If you have read this far, I REALLLLY appreciate it. And any ideas as to what is wrong would help alot.    <<Less
About | Sitemap | Contact