Read data from Ajax Jquery – Cross domain

I have a xml file, Please refer this link: XML

Username: admin

Password: admin

I am using Ajax jquery with Json to connect and get data from this url xml.

What the code working ? it’s work when click a button (OnClientClick). It’s call a fuction from ajax to code behind in c#.

This is my code:

function Getdata() {
  $.ajax({
    crossDomain: true,
    type: "POST",
    contentType: "application/json; charset=utf-8",
    async: false,
    url: "http://huysoi.com/data.xml",
    username: 'admin',
    password: 'admin',
    data: '',
    dataType: "jsonp",
    success: // i need to help here
    // if it's success, i want to get all data in this url XML as TEXT
    // It's mean, all data will be in TEXT
    // If yes, i can download this Text file to my PC
    // That is my idea.
 });
}

I’ll try so hard to show you my idea, sorry if my question is unclear.

Thank for your help.


Source: ajax

Leave a Reply