Note that there are some explanatory texts on larger screens.

plurals
  1. PORunning Ajax in IE, FF, and Safari
    primarykey
    data
    text
    <p>I'm trying to create an ajax connection to a weather xml feed and then parse returned data. I don't have any issues making a connection via IE, but for some reason I don't have any luck in FF or Safari. Basically what I'm doing is running an html file that contains the following code.</p> <pre><code>&lt;html&gt; &lt;script type="text/javascript" language="javascript"&gt; function makeRequest(zip) { var url = 'http://rdona.accu-weather.com/widget/rdona/weather-data.asp?location=' + zip; //var httpRequest; var httpRequest = false; if (window.XMLHttpRequest) { document.write("xmlhttprequest"); httpRequest = new XMLHttpRequest(); if (httpRequest.overrideMimeType) { httpRequest.overrideMimeType('text/xml'); // See note below about this line } } else if (window.ActiveXObject) { // IE try { httpRequest = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { httpRequest = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {} } } if (!httpRequest) { alert('Giving up :( Cannot create an XMLHTTP instance'); return false; } httpRequest.onreadystatechange = function() { alertContents(httpRequest); }; httpRequest.open('GET', url, true); httpRequest.send(''); } function alertContents(httpRequest) { if (httpRequest.readyState == 4) { if (httpRequest.status == 200) { alert(httpRequest.responseText); } else { alert('There was a problem with the request.'); } } } makeRequest(84405); &lt;/script&gt; &lt;/html&gt; </code></pre> <p>Any help and or suggestions would be greatly appreciated.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload