Wednesday
Mar042009
jQuery 1.3 - Case Insensitive :contains()
Eric Phan |
Wednesday 04 March 2009 at 06:24 AM Ran into a bit of an issue today when I upgraded the jQuery on a website I was working on to the new 1.3.2 version. I got the following error:
Object doesn’t support this property or method.
There is a fix for this. You will need to update your jQuery extension code to the following:
$.extend($.expr[":"], {
"containsNC": function(elem, i, match, array) {
return (elem.textContent || elem.innerText || "").toLowerCase
().indexOf((match[3] || "").toLowerCase()) >= 0;
}
});
Now all is peachy clean (although this new script seems to perform slower than the old one. I will see if I can optimize it)
tagged
Javascript,
jQuery in
Development
Javascript,
jQuery in
Development 
Reader Comments (11)
Updating libraries on a client project midstream
Hmmm :)
Thanks! Saved me a few hours.
Great solution! Added into a filter solution for SharePoint and lists. Your code provided the best results!!!!
Tanks!!!
Thanks for solution! Works great!
Very nice, thanks.
Thanks!
Thanks Man!! it works.
Thanks!!
Saves some coding.
I need the not contains function
How can i write??
Help me please
@Sudhakarreddy, look into the not function for jQuery
Not working in IE9, any suggestions? Thanks!