Note that there are some explanatory texts on larger screens.

plurals
  1. POFirefox local ajax call
    primarykey
    data
    text
    <p>I have implemented the solution found <a href="https://stackoverflow.com/questions/436670/local-html-file-ajax-call-and-jquery-woes">here</a>, but it is not working in Firefox. </p> <p><strike>IE loads and reads the XML document fine</strike> Strike that, if the type of data is "string" the data variable holds the XML, but loading it into the xml variable returns the same function below. The XML file is a flat filed stored in the same folder as the HTML file. The file is being ran from <code>"file:///D:/..."</code>, not from a webserver. </p> <p><strong>Firefox</strong> version is <strong>16.0.2</strong> and I have tried <strong>jquery 1.7.1 and 1.8.2</strong>. I have done a <code>dataType</code> comparison and the data is not <code>XML</code>, but just says <code>Object</code>. </p> <p>I did an alert of <code>$(data).contents</code> and get:</p> <pre><code>function (c, d) { var e = p.map(this, b, c); return bc.test(a) || (d = c), d &amp;&amp; typeof d == "string" &amp;&amp; (e = p.filter(d, e)), e = this.length &gt; 1 &amp;&amp; !bg[a] ? p.unique(e) : e, this.length &gt; 1 &amp;&amp; bd.test(a) &amp;&amp; (e = e.reverse()), this.pushStack(e, a, k.call(arguments).join(",")); } </code></pre> <p>I have tried setting <code>security.fileuri.strict_origin_policy</code> to <strong>false</strong>, but that has no effect.</p> <p>Here is the code:</p> <pre><code>$.ajax({ url: "COBIE.xml", dataType: ($.browser.msie) ? "text" : "xml", success: function (data) { if (typeof data == "string") { xml = new ActiveXObject("Microsoft.XMLDOM"); xml.async = false; xml.loadXML(data); // Returned data available in object "xml" setMessage("XML date has been loaded"); } else if (typeof data == "xml") { xml = data; alert($(xml).contents); // Returned data available in object "xml" setMessage("XML date has been loaded"); } else { alert($(data).contents); setMessage("I have no idea what data you're trying to load"); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { setMessage(errorThrown); } }); </code></pre>
    singulars
    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.
 

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