I want to read a xml file generated from Drupal 7 using JQuery and Ajax.
When I type the http url link in url:' ' the Ajax function doesn't retrieve any data.
When I type my xml file as a local file (without http url) the Ajax function works normally.
The Ajax code is:
$(document).ready(function () {
$.ajax({
type: "GET",
url: "any http url that contains xml file",
dataType: "xml",
success: xmlParser
});
});
function xmlParser(xml) {
$('#load').fadeOut();
$(xml).find("movie-info").each(function () {
$(".main").append('<div class="book"><div class="title">' + $(this).find("title").text() + '</div><div class="description">' + $(this).find("field_genre").text() + '</div><div class="date">Published ' + $(this).find("field_poster").text() + '</div></div>');
$(".book").fadeIn(1000);
});