使用JS从URL读取XML

I was trying to read xml data provided by the url

url: http://api.simplyhired.co.in/a/jobs-api/xml-v2/q-java/l-hyderabad/ws-10?pshid=46408&ssty=3&cflg=r

but I am not getting any response data from the url. I tried below code:

var url = "http://api.simplyhired.co.in/a/jobs-api/xml-v2/q-java/l-hyderabad/ws-10?pshid=46408&ssty=3&cflg=r";

$.ajax({
    url: url,
    complete: function(data) {
        alert(data.responseText);
    }
});​

When I open url in the browser it shows data in xml format. The problem exists even after encoding the url.

Is there any better way of doing this?

Thanks.

try something like this

$.ajax({
        type: "GET",
    url: "www.mysite.com/file.xml",
    dataType: "xml",
    success: function(xml) {
       #do work here if success
    }
});

if this still not work, pay attention at your url, it have some chars that should be encoded (e.g. "=" that encoded is a "%3D")

see here for JQuery URI encoding: http://www.w3schools.com/jsref/jsref_encodeURIComponent.asp