views:

520

answers:

1

I am working on the following page.

http://www.ranger.ryerson.ca/library/test/steveDev/testcarousel/test.html

it works in firefox, chrome, and opera, but in IE6,IE7, and Safari (the god forsaken browsers) they all give me "parsererror"

My page uses the jquery XML parser, and the bad browsers dont like it. The troubled code is the following

$.ajax({
     type: "GET",
     url: "http://www.ranger.ryerson.ca/library/test/steveDev/testcarousel/readXML.cfm",


     dataType: "xml",
     success: function(xml) {
      $(xml).find('images').each(function(){
       $(this).find('pic').each(function() {
        temp= '<a href="'+$(this).find('link').text()+'"><img src="'+$(this).find('thumbnail').text()+'" width="'+$(this).find('width').text()+'" style="border-style: none" height="75" title="'+$(this).find('alt').text()+'"alt="'+$(this).find('alt').text()+'" /></a>';
        carousel.add(count, temp);
        count++;
       });
       carousel.size(count);
      });
     },
     error: function(XMLHttpRequest, textStatus, errorThrown){
      alert(textStatus);
     } 

    })

how can I resolve my problem

+1  A: 

There's an Encoding Error encountered on this node:

<alt>Eugénie</alt>

on line 97.

I notice you specify encoding="utf-8" as the encoding. Are you sure the "é" is really encoded with utf-8?

Roatin Marth
never noticed that. How can I escape this character?
Steven1350
Use the correct UTF-8 sequence for it: `é`
Matt Ball
Or... the HTML entity: `é`, or another way to write the character in Unicode: `U+00E9`. Keep in mind that the HTML entity will make an XML parser unhappy unless it's already been defined (see http://en.wikipedia.org/wiki/Character_encodings_in_HTML#XML_character_entity_references).
Matt Ball
Okay, you are correct about that é being the cause of the compatibility issues. However, I do not have access to change the XML source. Is there anyway to work around this?
Steven1350
Figure out what it actually *is* encoded as, and specify that encoding. It might just be Unicode, rather than UTF-8. I did notice that the é is not correctly displayed in the alt text for that album in Firefox.
Matt Ball