How to load a xml file in google chrome using javascript -


I am beginning web based programming on this site and new. I am trying to get the contents of XML tags, but when I open the code below in Chrome, nothing appears. Can someone give me a hint, please? Here's the full code:

  & lt ;! DOCTYPE html & gt; & Lt; Html & gt; & Lt; Top & gt; & Lt; Script & gt; var xmlDoc, xmlHttp; Function readxml () {xmlHttp = new window. XMLHttpRequest (); XmlHttp.open ("GET", 'books.xml', false); xmlHttp.send (zero); xmlDoc = xmlHttp.responseXML.documentElement; back xmlDoc;} & lt; / script> & lt; / head & Gt; & lt; body & gt; & lt; script & gt; var xmld xmld = readxml (); document.write (xmld.getElementsByTagName ("title") [0]. ChildNode [0] .nodeValue + "& lt ; Br & gt; "); document.write (xmld.getElementsByTagName (" author ") [0]. ChildNode [0] .nodeValue +" & lt; br & gt; "); document.write (xmlDoc.getElementsByTagName ( "Year") [0] .childNodes [0] .nodeValue);       

Hint: function readxml before xml is loaded. Are trying to write the document.

In this example reqListener View:

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -