Parsing XML with jQuery

Posted by Jamie on Stack Overflow See other posts from Stack Overflow or by Jamie
Published on 2010-05-08T20:29:09Z Indexed on 2010/05/08 20:38 UTC
Read the original article Hit count: 239

Filed under:
|
|
|
|

I've used this:

$(document).ready(function () {
$.ajax({
    type: "GET",
    url: "http://domain.com/languages.php",
    dataType: "xml",
    success: xmlParser
   });
});

function xmlParser(xml) {
  $('#load').fadeOut();
  $(xml).find("result").each(function () {

  $(".main").append('' + $(this).find("language").text() + '');
  $(".lang").fadeIn(1000);

  });
}

I used a local XML file on my computer, it works fine, but when I change the URL to an website, it just keeps loading all the time...

How do I get this to work?

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about Xml