padolsey-archive / jquery.fn

A collection of jQuery plugins
http://james.padolsey.com
The Unlicense
1.1k stars 723 forks source link

Requesting XML Data in Cross Domain AJAX #2

Open hleinone opened 13 years ago

hleinone commented 13 years ago

Requesting an XML file for example http://p3p.yahoo.com/w3c/p3p.xml will return:

</head> <body> <p>/\* </p> </body> </html> <p>While the expected value would be:</p> <META xmlns="http://www.w3.org/2001/09/P3Pv1"> <POLICY-REFERENCES> <POLICY-REF about="http://privacy.yahoo.com/us/w3c/p3p_us.xml"> <INCLUDE>/*</INCLUDE> </POLICY-REF> </POLICY-REFERENCES> </META> <p>This can be fixed be changing the query from <code>'select * from html where url="{URL}" and xpath="*"'</code> to <code>'select * from xml where url="{URL}"'</code> but it would make it unusable on other occasions. Is it possible to change the query when <code>dataType: "xml"</code> is requested?</p> </div> </div> <div class="page-bar-simple"> </div> <div class="footer"> <ul class="body"> <li>© <script> document.write(new Date().getFullYear()) </script> Githubissues.</li> <li>Githubissues is a development platform for aggregating issues.</li> </ul> </div> <script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js"></script> <script src="/githubissues/assets/js.js"></script> <script src="/githubissues/assets/markdown.js"></script> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/highlight.min.js"></script> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/languages/go.min.js"></script> <script> hljs.highlightAll(); </script> </body> </html>