Load XML via AJAX - IE8 not working

Load XML via AJAX - IE8 not working

So I have this newsfeed system which works perfectly on all browsers..... except IE8! Surprise!

Now, the code I have was made by trial and error, so there might be some obvious coding issues which I don't know...

Here's the external JS file (I use jQuery 1.7.2 btw)

  1. $(document).ready(function(){
  2.       $.ajax({
  3.             type: "GET",
  4.             url: "newsfeed_en.xml",
  5.             dataType: "html",
  6.             success: function(xml) {
  7.                   $(xml).find("element:first").each(function(){
  8.                   var year = $(this).find("year").text();
  9.                   var month = $(this).find("month").text();
  10.                   var day = $(this).find("day").text();
  11.                   var date = day+"-"+month+"-"+year;
  12.                   var newselement = '<div class="newsElement"><h4>'+date+'</h4><p>'+content+'</p></div>';
  13.                   $('#news h1').after(newselement);
  14.             });
  15.             $(xml).find("element:gt(0)").each(function(){
  16.                   var year = $(this).find("year").text();
  17.                   var month = $(this).find("month").text();
  18.                   var day = $(this).find("day").text();
  19.                   var date = day+"-"+month+"-"+year;
  20.                   var content = $(this).find("content").html();
  21.                   var newselement = '<div class="newsElement"><h4>'+date+'</h4><p>'+content+'</p></div>';
  22.                   $('#news #paneMoreNews').append(newselement);
  23.             });
  24.       });
  25. });
 
What it does is take the first ELEMENT and put it in one location, and all the others somewhere else.

Now I had to set datatype to HTML because some ELEMENT contain LINKS, but changing it to XML doesn't resolve the problem. Taking the ":first" away doesn't solve it either....

I searched this place, but none of the other solutions work.......

Many THANKS in advance!!!!!