Pretraži podršku

Izbjegni prevare podrške. Nikad te nećemo tražiti da nas nazoveš, da nam pošalješ telefonski broj ili da podijeliš osobne podatke. Prijavi sumnjive radnje pomoću opcije „Prijavi zlouporabu”.

Saznaj više

XMLHttpRequest() not working anymore

more options

I have to display some data from XML file inside a HTML page Both files (XML and HTML) are on a local disk of the same computer under Windows 10. What I'm describing a process that has been working for over 10 years.

Suddenly after a Firefox update (version 70) the data coming from the XML file was not displayed anymore. Lookung around I have discovered to set privacy.file_unique_origin to false and all was working again.

Now, after the Firefox version 71 update the page is still not working under Windows 10. (even with privacy.file_unique_origin set to false) I have tried on MacOS (FF ver. 71( and it is working correctly.

Because I have written the page 10 years ago and I am now no more active in the field I would like to ask if somebody can give me some help. Here the part of code related to the decode of XLM

Part of HTML

<table border="0" width="100%">
  <tr>
    <td bgcolor="#ccffcc"><center><font face="Verdana" size=5><b>&nbsp;&nbsp;Dati alle ore&nbsp;&nbsp;</b></td>
    <td bgcolor="#ccffcc"><center><font face="Verdana" size=5><b>&nbsp;&nbsp;Temperatura&nbsp;&nbsp;</b></td>
    <td bgcolor="#ccffcc"><center><font face="Verdana" size=5><b>&nbsp;&nbsp;Umidit&agrave;&nbsp;&nbsp;</b></td>
    <td bgcolor="#ccffcc"><center><font face="Verdana" size=5><b>&nbsp;&nbsp;&nbsp;Vento km/h&nbsp;&nbsp;&nbsp;</b></td>
    <td bgcolor="#ccffcc"><center><font face="Verdana" size=5><b>&nbsp;&nbsp;&nbsp;&nbsp;Pressione&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b></td>
    <td bgcolor="#ccffcc"><center><font face="Verdana" size=5><b>&nbsp;&nbsp;Pioggia odierna&nbsp;&nbsp;</b></td>
  </tr>
  <tr style="height: 50; ">
    <td bgcolor="#FFFFFF"><center><font face="Verdana" size=6><span id="time"></span></td>
    <td bgcolor="#FFFFFF"><center><font face="Verdana" size=6><span id="temp"></span> &deg;C</td>
    <td bgcolor="#FFFFFF"><center><font face="Verdana" size=6><span id="hum"></span> %</td>
    <td bgcolor="#FFFFFF"><center><font face="Verdana" size=6><span id="windspeed"></span> <span id="winddircart"></span></td>
    <td bgcolor="#FFFFFF"><center><font face="Verdana" size=6><span id="baro"></span> hPa</td>
    <td bgcolor="#FFFFFF"><center><font face="Verdana" size=6><span id="dayrain"></span> mm</td>
  </tr>
 </table>

	<script>
	var xmlhttp, xmlDoc;
	xmlhttp = new XMLHttpRequest();
	xmlhttp.open("GET", "./marzio/Web/wlfulldata.xml", false);
	xmlhttp.send();
	xmlDoc = xmlhttp.responseXML;
	document.getElementById("time").innerHTML=
	xmlDoc.getElementsByTagName("TIME")[0].childNodes[0].nodeValue;
	document.getElementById("temp").innerHTML=
	xmlDoc.getElementsByTagName("TEMP")[0].childNodes[0].nodeValue;
	document.getElementById("hum").innerHTML=
	xmlDoc.getElementsByTagName("HUM")[0].childNodes[0].nodeValue;
	document.getElementById("windspeed").innerHTML=
	xmlDoc.getElementsByTagName("WINDSPEED")[0].childNodes[0].nodeValue;
	document.getElementById("winddircart").innerHTML=
	xmlDoc.getElementsByTagName("WINDDIRCARD")[0].childNodes[0].nodeValue;
	document.getElementById("baro").innerHTML=
	xmlDoc.getElementsByTagName("BARO")[0].childNodes[0].nodeValue;
	document.getElementById("dayrain").innerHTML=
	xmlDoc.getElementsByTagName("DAYRAIN")[0].childNodes[0].nodeValue;
	</script>


</body>
</html>

Part of XML file

<?xml version="1.0"?>

<!--File Name: wlfulldata.xml-->

<WXDATA>
	<PARAM>
<DATE>14/01/17</DATE>
<TIME>17:45</TIME>
<STADATE>14/01/17</STADATE>
<STATIME>17:44</STATIME>
<UTCDATE>14/01/17</UTCDATE>
<UTCTIME>16:45</UTCTIME>
<STANAME>marzio</STANAME>
<CITY> </CITY>
<STATE> </STATE>
<ELEV>  725 m</ELEV>
<SUNRISE> 8:03</SUNRISE>
<SUNSET>17:07</SUNSET>
<TEMP>1.5</TEMP>
<TEMPHI>5.8</TEMPHI>
<TEMPHIT>13:42</TEMPHIT>
<TEMPLO>-2.6</TEMPLO>
<TEMPLOT> 5:34</TEMPLOT>
<TEMPHIMO>12.1</TEMPHIMO>
<TEMPLOMO>-6.0</TEMPLOMO>
<TEMPHIYR>12.1</TEMPHIYR>
<TEMPLOYR>-6.0</TEMPLOYR>
<HUM>52</HUM>
<HUMUNIT>% </HUMUNIT>
<HUMHI>81</HUMHI>
<HUMHIT> 7:26</HUMHIT>
<HUMLO>36</HUMLO>
……
…...
I have to display some data from XML file inside a HTML page Both files (XML and HTML) are on a local disk of the same computer under Windows 10. What I'm describing a process that has been working for over 10 years. Suddenly after a Firefox update (version 70) the data coming from the XML file was not displayed anymore. Lookung around I have discovered to set privacy.file_unique_origin to false and all was working again. Now, after the Firefox version 71 update the page is still not working under Windows 10. (even with privacy.file_unique_origin set to false) I have tried on MacOS (FF ver. 71( and it is working correctly. Because I have written the page 10 years ago and I am now no more active in the field I would like to ask if somebody can give me some help. Here the part of code related to the decode of XLM Part of HTML <pre><nowiki> <table border="0" width="100%"> <tr> <td bgcolor="#ccffcc"><center><font face="Verdana" size=5><b>&nbsp;&nbsp;Dati alle ore&nbsp;&nbsp;</b></td> <td bgcolor="#ccffcc"><center><font face="Verdana" size=5><b>&nbsp;&nbsp;Temperatura&nbsp;&nbsp;</b></td> <td bgcolor="#ccffcc"><center><font face="Verdana" size=5><b>&nbsp;&nbsp;Umidit&agrave;&nbsp;&nbsp;</b></td> <td bgcolor="#ccffcc"><center><font face="Verdana" size=5><b>&nbsp;&nbsp;&nbsp;Vento km/h&nbsp;&nbsp;&nbsp;</b></td> <td bgcolor="#ccffcc"><center><font face="Verdana" size=5><b>&nbsp;&nbsp;&nbsp;&nbsp;Pressione&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b></td> <td bgcolor="#ccffcc"><center><font face="Verdana" size=5><b>&nbsp;&nbsp;Pioggia odierna&nbsp;&nbsp;</b></td> </tr> <tr style="height: 50; "> <td bgcolor="#FFFFFF"><center><font face="Verdana" size=6><span id="time"></span></td> <td bgcolor="#FFFFFF"><center><font face="Verdana" size=6><span id="temp"></span> &deg;C</td> <td bgcolor="#FFFFFF"><center><font face="Verdana" size=6><span id="hum"></span> %</td> <td bgcolor="#FFFFFF"><center><font face="Verdana" size=6><span id="windspeed"></span> <span id="winddircart"></span></td> <td bgcolor="#FFFFFF"><center><font face="Verdana" size=6><span id="baro"></span> hPa</td> <td bgcolor="#FFFFFF"><center><font face="Verdana" size=6><span id="dayrain"></span> mm</td> </tr> </table> <script> var xmlhttp, xmlDoc; xmlhttp = new XMLHttpRequest(); xmlhttp.open("GET", "./marzio/Web/wlfulldata.xml", false); xmlhttp.send(); xmlDoc = xmlhttp.responseXML; document.getElementById("time").innerHTML= xmlDoc.getElementsByTagName("TIME")[0].childNodes[0].nodeValue; document.getElementById("temp").innerHTML= xmlDoc.getElementsByTagName("TEMP")[0].childNodes[0].nodeValue; document.getElementById("hum").innerHTML= xmlDoc.getElementsByTagName("HUM")[0].childNodes[0].nodeValue; document.getElementById("windspeed").innerHTML= xmlDoc.getElementsByTagName("WINDSPEED")[0].childNodes[0].nodeValue; document.getElementById("winddircart").innerHTML= xmlDoc.getElementsByTagName("WINDDIRCARD")[0].childNodes[0].nodeValue; document.getElementById("baro").innerHTML= xmlDoc.getElementsByTagName("BARO")[0].childNodes[0].nodeValue; document.getElementById("dayrain").innerHTML= xmlDoc.getElementsByTagName("DAYRAIN")[0].childNodes[0].nodeValue; </script> </body> </html> </nowiki></pre> Part of XML file <pre><nowiki> <?xml version="1.0"?> <!--File Name: wlfulldata.xml--> <WXDATA> <PARAM> <DATE>14/01/17</DATE> <TIME>17:45</TIME> <STADATE>14/01/17</STADATE> <STATIME>17:44</STATIME> <UTCDATE>14/01/17</UTCDATE> <UTCTIME>16:45</UTCTIME> <STANAME>marzio</STANAME> <CITY> </CITY> <STATE> </STATE> <ELEV> 725 m</ELEV> <SUNRISE> 8:03</SUNRISE> <SUNSET>17:07</SUNSET> <TEMP>1.5</TEMP> <TEMPHI>5.8</TEMPHI> <TEMPHIT>13:42</TEMPHIT> <TEMPLO>-2.6</TEMPLO> <TEMPLOT> 5:34</TEMPLOT> <TEMPHIMO>12.1</TEMPHIMO> <TEMPLOMO>-6.0</TEMPLOMO> <TEMPHIYR>12.1</TEMPHIYR> <TEMPLOYR>-6.0</TEMPLOYR> <HUM>52</HUM> <HUMUNIT>% </HUMUNIT> <HUMHI>81</HUMHI> <HUMHIT> 7:26</HUMHIT> <HUMLO>36</HUMLO> …… …...</nowiki></pre>

Izmjenjeno od cor-el

Izabrano rješenje

Could you check for messages in Firefox's Web Console. You can open the Web Console in the lower part of the tab using either:

  • "3-bar" menu button > Web Developer > Web Console
  • (menu bar) Tools > Web Developer > Web Console
  • (Windows) Ctrl+Shift+k

Click the trash can in the upper left corner to clear the existing messages. Then check for new messages after each action, such as:

  • Reloading the page (Ctrl+r)
  • Navigating to another page
  • Clicking buttons, etc.

Does the console mention any issue with blocked content or script errors?

Pročitaj ovaj odgovor u kontekstu 👍 0

Svi odgovori (2)

more options

Odabrano rješenje

Could you check for messages in Firefox's Web Console. You can open the Web Console in the lower part of the tab using either:

  • "3-bar" menu button > Web Developer > Web Console
  • (menu bar) Tools > Web Developer > Web Console
  • (Windows) Ctrl+Shift+k

Click the trash can in the upper left corner to clear the existing messages. Then check for new messages after each action, such as:

  • Reloading the page (Ctrl+r)
  • Navigating to another page
  • Clicking buttons, etc.

Does the console mention any issue with blocked content or script errors?

more options

Many thanks for your answer. Due to your suggestion I was able to find that in the XML file there was an element containing an accented character and this was the reason because the XML file was not loaded.

Best wishes for the next year!