Go Back   PCMech Forums > Help & Discussion > Web Design / Development

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 10-27-2006, 10:00 PM   #1
Member (2 bit)
 
Join Date: Oct 2006
Posts: 2
fqpissed AJAX Issue?

I'm trying to display text/data from an XML file onto an HTML file using JavaScript.

When I display the XML without using JavaScript, it will retain how it was "formatted" in XML.

When I use JavaScript to retrieve and display the XML, it doesn't.

I need to find out how to fix this.....


Example (this works):

Code:
[span datasrc="#eMaps" datafld="ClickOn" id="ClickOn"][/span]

Example (this doesn't work):

Code:
[script type="text/javascript"]
		var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
		function loadXML(xmlFile)
		{
		xmlDoc.async="false";
		xmlDoc.onreadystatechange=verify;
		xmlDoc.load(xmlFile);
		xmlObj=xmlDoc.documentElement;
		}
		function verify()
		{
		// 0 Object is not initialized
		// 1 Loading object is loading data
		// 2 Loaded object has loaded data
		// 3 Data from object can be worked with
		// 4 Object completely initialized
		if (xmlDoc.readyState != 4)
		{
		return false;
		}
		}
		loadXML('eMaps.xml');
		
		
	function showText(box)
	{
		var s = "";
		var h = "";
				
		switch(box)
		{
		case 2:
			s=(xmlObj.childNodes(1).text);
			h="Opening";
			break;
		case 3:
			s=(xmlObj.childNodes(3).text);
			h="Reason";
			break;
		default:
			s=(xmlObj.childNodes(0).text);
			break;
			}
			ClickOn.innerHTML=s;
			header.innerHTML=h;
			}
	[/script]

Last edited by nickdmoore; 10-27-2006 at 10:07 PM.
nickdmoore is offline   Reply With Quote
Old 10-30-2006, 10:48 PM   #2
Member (2 bit)
 
Join Date: Oct 2006
Posts: 2
Nevermind - found a solution. Thanks
nickdmoore is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sometimes my router just doesn't reconnect. indigo0086 Networking & Online Security 10 07-26-2006 10:51 AM
Same old issue...can't find my CD Rom.. Powerstroke2000 Computer Hardware 6 02-09-2006 07:43 PM
Aol connection issue bdanner302 Networking & Online Security 3 01-09-2005 12:04 AM
Unusual issue with WMP scomac Software Discussion & Support 0 09-04-2004 07:48 AM
Intermittent power issue Kean Computer Hardware 6 06-14-2002 05:42 PM


All times are GMT -5. The time now is 05:14 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 PL2