SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Threaded View

  1. #1
    SitePoint Addict
    Join Date
    Aug 2006
    Posts
    266
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    xmlDoc.getElementsByTagName("ForexBuying")[0].childNodes[0].nodeValue;

    This code is working on İnternet Explorer. But it is not working on Firefox and Opera. What can I do? Thanks...
    Code:
     
    <html>
    <head>
    <script type="text/javascript">
    var xmlDoc;
    function loadXML()
    {
    // for IE 
    if (window.ActiveXObject)
    {
    	xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
    	xmlDoc.async=false;
    	xmlDoc.load("http://www.tcmb.gov.tr/kurlar/today.xml");
    	getmessage();
    }
    // for Mozilla, Firefox, Opera, 
    else if (document.implementation && document.implementation.createDocument)
    {
    	xmlDoc=document.implementation.createDocument("","",null);
    	xmlDoc.load("http://www.tcmb.gov.tr/kurlar/today.xml");
    	xmlDoc.onload=getmessage;
    }
    else
    {
    	alert('Your browser does not support this script.');
    }
    }
    
    function getmessage()
    {
    var a = xmlDoc.getElementsByTagName('Currency')[0]
    document.getElementById("veri1").innerHTML=a.getElementsByTagName("ForexBuying")[0].childNodes[0].nodeValue;
    document.getElementById("veri2").innerHTML=a.getElementsByTagName("ForexSelling")[0].childNodes[0].nodeValue;
    document.getElementById("veri3").innerHTML=a.getElementsByTagName("BanknoteBuying")[0].childNodes[0].nodeValue;
    document.getElementById("veri4").innerHTML=a.getElementsByTagName("BanknoteSelling")[0].childNodes[0].nodeValue;
    
    }
    </script>
    <style type="text/css">
    b { color:red;}
    h3 {color:blue;}
    </style>
    </head>
    
    <body onload="loadXML()">
    <h3>AMERİKAN DOLARI- US DOLLAR</h3>
    <p><b>D&#246;viz Alış (Forex Buying)</b> <span id="veri1"></span><br />
    <p><b>D&#246;viz Satış (Forex Selling)</b> <span id="veri2"></span><br />
    
    <p><b>Efektif Alış (Banknote Buying)</b> <span id="veri3"></span><br />
    <p><b>Efektif Satış (Banknote Selling)</b> <span id="veri4"></span>
    </p>
    </body>
    </html>
    Last edited by muazzez; May 27, 2007 at 22:56.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •