Search code examples
javascriptjquerysizzle

Accessing Sizzle methods via jQuery


In the jQuery source it clearly says jQuery.find = Sizzle;

but when i try to access a particular Sizzle method the function doesn't exist. This is what the objects look like.

window.Sizzle   |   window.jQuery.find

.isXML          |   .isXML
.matches        |   .matches
.matchesSelector|   .matchesSelector
.contains       |   .contains
.attr           |   .attr
.error          |   .error
.uniqueSort     |   .uniqueSort
.getText        |   .getText
.selectors      |   .selectors
.tokenize       |   
.compile        |   
.select         |   
.support        |   
.setDocument    |   
                |   .find
                |   .filter 

I don't understand why the jquery team would overwrite/delete the methods. Is there a way of accessing these missing functions or do I have to download the sizzle library ? The method I need it tokenize.

jquery source
Sizzlejs source

Many Thanks


Solution

  • AFAIK you can use $.find.tokenize - see issue https://github.com/jquery/sizzle/issues/242