user233111
user233111

Reputation: 53

jQuery .get() not working in IE8

I was recently informed that a routine I wrote is not working in IE. I know that it has worked for quite some time, so perhaps the issue is related to the newer version of IE. The code is:

$(document).ready(
  function() {
    var aryRSS = new Array(5);

    $.get(
      'slider_info.xml',
      function($xml) {
        var html = "";
        var i = 1;
        $($xml).find('item').each(
          function() {
            var item_link  = $(this).find('item_link').text();  // The three pieces of information requested within the XML file
            var item_title = $(this).find('item_title').text().replace(/'/g, '''); 
            var item_image = $(this).find('item_image').text();
            // Build list items for slider
            html += "<li id='hp_images_nav" + i + "' title='" + item_title + "'";
            if (i == 1) { html += " class='hp_images_navSelected'"; }
            html += ">" + i + "</li>";
            // Build title, link, and image
            aryRSS[i] = "<h2><a href='" + item_link + "'>"
            aryRSS[i] += item_title + "</a></h2>"; // Add link and title for display outside rotation
            aryRSS[i] += "<a href='" + item_link + "'><img src='" + item_image + "' alt='" + item_title + "' title='Click to view article' /></a>"; // Extract the image from the description
            i++;
          }
        )
        $('#remove_this').remove(); // Remove empty list item, which exists for purpose of validation
        $('#hp_images_nav_items').append(html); // 
        $('#hp_images_nav').append('<div id="stop_start">||</div>');
        $('#hp_images').append(aryRSS[1]); // Create initial item
      },
      'xml'
    );
  }
)

I am getting a valid XML file and using its contents to build HTML. This works like a champ on everything with the exception of IE (I am using IE9, I believe that this is also an issue with IE8).

I have tried all sorts of things and am out of ideas. This is something I really need to get fixed, so any ideas would be greatly appreciated.

Cheers -

george

Upvotes: 0

Views: 478

Answers (1)

Eric Herlitz
Eric Herlitz

Reputation: 26277

You are missing a semicolon on the row

aryRSS[i] = "<h2><a href='" + item_link + "'>"

Many browsers handles this but IE < 9 don't.

Upvotes: 1

Related Questions