Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JQuery error: XML filter is applied to non-XML value (function (E, F) {return new (o.fn.init)(E, F);})

Tags:

json

jquery

I am getting this slightly cryptic error message:

XML filter is applied to non-XML value (function (E, F) {return new (o.fn.init)(E, F);})

when I run this code snippet

function justDoIt(arg){
    msg = arg.msg;
    if(arg.ok)
        jQuery.(".action-button").each(function(idx,el){jQuery(this).removeClass('enabled');} );
}

arg is a JSON format response form the server.

Anyone knows how to fix this?

like image 945
morpheous Avatar asked Apr 26 '10 06:04

morpheous


1 Answers

On the 4th line there's a . after jQuery that you should remove:

if(arg.ok) {
    $('.action-button').each(function() {
        $(this).removeClass('enabled');
    });
}

Which could be simplified to:

if(arg.ok) {
    $('.action-button').removeClass('enabled');
}
like image 71
Darin Dimitrov Avatar answered Oct 27 '22 20:10

Darin Dimitrov