Skip to content
This repository has been archived by the owner on Dec 5, 2023. It is now read-only.

I get an error: #1

Open
ccorcos opened this issue Apr 21, 2014 · 1 comment
Open

I get an error: #1

ccorcos opened this issue Apr 21, 2014 · 1 comment

Comments

@ccorcos
Copy link

ccorcos commented Apr 21, 2014

Uncaught TypeError: undefined is not a function fuzzy.js?9fd92688852714542edcf93e036b4aea0d3d9104:82

@TravisSpangle
Copy link

I got this error as well. When I switched to the full version the exception happened to me on line 82 for the function:

function allCaseInsensitiveSplits(string, chr)

It failed because string was a 0 and the function being called was for a string data type not a number.

To resolve it I played with the example code and it appears to be wrong. Instead of passing 'a' you want to pass 'this'.

So

callback($(['dog', 'cat', 'cow']).filter(function (a) {
                // Only show items which match
                return $.fuzzyMatch(a, context.term).score;

needs to be

callback($(['dog', 'cat', 'cow']).filter(function (a) {
                // Only show items which match
                return $.fuzzyMatch(this, context.term).score;

This corrected the problem for me.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants