2

The XML feed for my autocomplete is on another server. Is there a client side (javascript) method of getting this XML document?

I know I can create a proxy with php, jsp, etc.. but I need to do it all client side. This is how I call the file now that only works if it is on the same domain:

function callAjax(url) {
  $.ajax({
        url : url,
        dataType : "xml",
        success : function(xmlResponse) {
              totalrec = $("TOTALREC", xmlResponse).text();
            $.merge(data1, $("ROW", xmlResponse).map(returnResults).get());
        }// end of success
  });
Specked
  • 23
  • 1
  • 4

2 Answers2

0

You could do it using JSONP

  dataType: 'jsonp'

Here you have living demo:

http://jqueryui.com/demos/autocomplete/#remote-jsonp

This doesn't do it with xml, but json. But shouldn't be hard to change it.

hope this helps. Cheers

Edgar Villegas Alvarado
  • 18,204
  • 2
  • 42
  • 61
  • That wont work for me. My restraints are that the data is XML and lives on another domain. As I said in the post, I can't use php or other technologies to help process, as it needs to be done client side. – Specked May 06 '11 at 20:58
0

YQL might be able to do what you want. It allows you to do cross-domain requests.

Have a look at this: Cross-domain requests with jQuery

H.T.H

Karis Sr.
  • 171
  • 2
  • 12