karwanpro Posted May 24, 2014 Share Posted May 24, 2014 hi friend i am used the java script to display the currency of Iraqi dinars from this xml file http://www.xe.com/datafeed/samples/sample-xml-usd.xml and i used this code <script>if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); }else { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); }xmlhttp.open("GET","http://www.xe.com/datafeed/samples/sample-xml-usd.xml",false);xmlhttp.send();xmlDoc=xmlhttp.responseXML; currency=xmlDoc.getElementsByTagName("crate")[65].childNodes[0].nodeValue;document.write(currency);</script> but that is not work and i don't know why? please tell me what is my mistakes ... help me Link to comment Share on other sites More sharing options...
thescientist Posted May 24, 2014 Share Posted May 24, 2014 what is happening? Are you checking for errors in your console? Checking the networks tab to see that the request goes out and comes back successfully? Are you sure each part of this line is correct? xmlDoc.getElementsByTagName("crate")[65].childNodes[0].nodeValue; have you confirmed each part building it up piece by piece to make sure that nodeValue exists where you expect it? Link to comment Share on other sites More sharing options...
karwanpro Posted May 24, 2014 Author Share Posted May 24, 2014 thanks thescientist , i am try many ways and i can not get the data of currency of Iraqi dinar from this xml file please if you can know any code to this task informed me Link to comment Share on other sites More sharing options...
thescientist Posted May 24, 2014 Share Posted May 24, 2014 i just gave you about three things to try. answer those questions and I will be able to help you more. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now