JQuery Ajax Parsererror
-
20-09-2019 - |
Pergunta
Estou trabalhando na página seguinte.
http://www.ranger.ryerson.ca/library/test/stevedev/testcarousel/test.html
Funciona no Firefox, Chrome e Opera, mas no IE6, IE7 e Safari (o deus que abandonou os navegadores), todos eles me dão "Parsererror"
Minha página usa o analisador xml jQuery e os navegadores ruins não gostam. O código problemático é o seguinte
$.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);
}
})
Como posso resolver meu problema
Solução
Há um erro de codificação encontrado neste nó:
<alt>Eugénie</alt>
na linha 97.
Eu noto que você especifica encoding="utf-8"
como a codificação. Tem certeza do "é"
é realmente codificado com UTF-8?
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow