jquery自动完成不工作ie

leo*_*ora 2 jquery internet-explorer autocomplete

在firefox和chrome中运行得很漂亮,但是给出了一个错误:

"名称为空或不是对象"

我在下面以粗体显示IE中失败的行.

$("#toemail").autocomplete(emails, {  
    minChars: 0,  
    width: 310,  
    matchContains: true,  
    autoFill: false,  
    formatItem: function(row, i, max) {  
        return i + "/" + max + ": \"" + row.name + "\" [" + row.to + "]";  
    },  
    formatMatch: function(row, i, max) {  
        **return row.name + " " + row.to;**  
    },  
    formatResult: function(row) {  
        return row.to;  
    }
});
Run Code Online (Sandbox Code Playgroud)

编辑:我想通了......回答如下.

leo*_*ora 5

我想通了它在JSON列表中最后一项的末尾是一个额外的逗号.看起来像FF并不关心,但IE确实如此.