0

Possible Duplicate:
IE9 jQuery AJAX with CORS returns “Access is denied”

Have a bit of a problem with my .ajax call to an remote xml file. Works fine in Safari not IE 9. It might be possible this is a cross domain issue on IE or perhaps my XML parsing is bad.

/* Last FM Scrobbler - get album XML details */
refreshArtwork('Snow Patrol', 'chasing cars');
function refreshArtwork(artist, track) {    
    $.ajax({
  type: 'POST',
  url: 'http://ws.audioscrobbler.com/2.0/',
  data: {
        method: 'track.getInfo',
        api_key: 'c88cc53549*******46f056dc05a745',
        artist: artist,
        track: track,
        //format: 'json'
        },
  dataType: 'xml', //set to json if above
  success: getLastfm
});
}

/* parse album XML from LastFM scrobbler */
function getLastfm(xml) {

lstAlbum = $(xml).find('title').text();
lstAlbumart = $(xml).find('image[size="large"]').text();
lstWiki = $(xml).find('summary').text();
lstURL = $(xml).find('url').eq(0).text();

alert(lstAlbumart);
$(".current").html('<div class="playing"><div class="title">' + '<img src="' + lstAlbumart + '" width="250" height="250" /></div></div>');

  }// end of getLastfm() function


//***** remote xml here for reference ******//

http://ws.audioscrobbler.com/2.0/?method=track.getInfo&api_key=c88cc53549*******46f056dc05a745&artist=snow%20patrol&track=chasing%20cars
Community
  • 1
  • 1
hillcreative
  • 133
  • 2
  • 11

1 Answers1

0

check your XML response and make sure the XML is valid. Also don't do cross domain requests if you are using XML. If doing cross domain requests use dataType: 'JSONP'

Subtubes
  • 15,851
  • 22
  • 70
  • 105