Computer problems,Computer help
*AX SOFT>>>Programming & Design

Javascript and XML not cooperating?


I've loaded the XML document into JavaScript:

<script type="text/javascript">

var xml=document .implementation .createDocument ("","",null);

xml .async="false";
xml .load("metal.xml");

</script>

but using the script
<script type="text/javascript">

document.write (xml .getElementsByTagName ("title")[0] .childNode[0] .nodeValue)

</script>
gives me a blank space on the page. I'm trying to ".write" the text inside of the first <title> tag inside my XML document. I believe that the XML file is being loaded correctly, since removing ".childNode[0] .nodeValue" gives me "[object Element]" written on the page. Does anyone see a problem with the code? I've been trying to find the answer for 3 hours, someone help >:(

I'm using Firefox.

childNode[0] should be childNodes[0]

Next - what are the value of:
....childNodes[0].nodeType (should be 3)
....childNodes[0].nodeName (should be #text)
....childNodes[0].nodeValue (should be your value)

Tags
  General - Computers & Internet   Software   Security   Programming & Design   Facebook   Flickr   Google   MSN   MySpace
Related information
  • Phonebook program??

    Ok, if u do not want to talk about databases, then keep reading. Write a class named "PhoneBook", this class should contain at least the following instance variables: 1- Name (person�...

  • Graphic Designer raise?

    the economy is in a toilet right now. so I'd say the raise wasn't even 3% (did i check the math right?) anyway... your lucky you even got a raise. many companies are forced to say - i...

  • How do you delete a page from your Piczo Account?

    1]Go to "My Site" 2] Click on the "Organize" tab at the top 3] In the "Named Pages" section you will see all your pages. 4] Click on "Organizer"next to th...

  • What's the next killer app?

    Safe security area accessible from the net where I can store links with username/password. I hate having to remember all the usernames, links, passwords. I just want to go to a webpage and have my ...

  • Were can i get java script is it free?

    If you mean "javascript," then YES it is free! It comes as part of your web browser! All you need is a basic text editor and some knowledge of HTML to learn javascript... If you mean &...

  • How do you start a Website and make money from the links?

    To start a website you need to sign up for hosting. I recommend anybody with site builder. Beginners use site builder, everybody else uses html. If you learn html then you can make much better webs...

  • Using the dreaded goto command?

    Of course it would be worse... when you call a function, the code has to save the state of the previous functions in the registers, set up stack frames... all of which would be avoided if you used ...

  • Simple database (SQL) question?

    Well, it really depends on what language the web page is coded in, but if it is a Microsoft technology, I might suggest using the ADO library of tools. Here is a great link to some info about it : ...

  •  

    Categories--Copyright/IP Policy--Contact Webmaster