I’m having trouble implementing this. From other questions I have the following snippet:
jQuery.expr[":"].Contains = jQuery.expr.createPseudo(function(arg) {
return function( elem ) {
return jQuery(elem).text().toUpperCase().indexOf(arg.toUpperCase()) >= 0;
};
});
But I get the error: TypeError: jQuery.expr.createPseudo is not a function
Any ideas? In addition, where should this snippet be placed? Document ready?
Thanks,
Dave
Don’t use
createPseudo:From here.
It doesn’t matter where you put this – you’re just defining a function, not accessing the DOM – so it doesn’t have to be inside
document.ready. Just make sure you load jQuery before you define this filter and define it before you use it. Hope this helps!