代码之家  ›  专栏  ›  技术社区  ›  Señor Reginold Francis

jQuery AJAX解析器错误

  •  1
  • Señor Reginold Francis  · 技术社区  · 16 年前

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

    它适用于firefox、chrome和opera,但在IE6、IE7和Safari(被上帝抛弃的浏览器)中,它们都给了我“parsererror”

    我的页面使用jQueryXML解析器,糟糕的浏览器不喜欢它。问题代码如下

    $.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);
            } 
    
        })
    

    我怎样才能解决我的问题

    1 回复  |  直到 16 年前
        1
  •  2
  •   Roatin Marth    16 年前

    此节点上遇到编码错误:

    <alt>Eugénie</alt>
    

    第97行。

    encoding="utf-8" 作为编码。你确定 "é"