Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError undefined is not a function #102

Closed
valtido opened this issue Mar 19, 2014 · 8 comments
Closed

TypeError undefined is not a function #102

valtido opened this issue Mar 19, 2014 · 8 comments

Comments

@valtido
Copy link

valtido commented Mar 19, 2014

I keep getting this error:

Uncaught TypeError: undefined is not a function jquery.stupidTable.min.js:26

(anonymous function) jquery.stupidTable.min.js:26
(anonymous function)

The method in question is:

h.sort(function(a, b) {
    return m(a[0], b[0])
});
@joequery
Copy link
Owner

Can you please provide a full example?

@valtido
Copy link
Author

valtido commented Mar 19, 2014

I think its the date method missing, also maybe: do a check

If (typeof m != "undefined") m(a[0],b[0])

Ill provide more information when i am on a computer if this does not help.

@joequery
Copy link
Owner

There is no date method.

@valtido
Copy link
Author

valtido commented Mar 20, 2014

I have put
<... data-sort="date" ... >

So the script is failing to find m method which is equal to m = b[l] b is the stack of methods such as int, float, string, and l I think may be the custom types.

@realtebo
Copy link

if you are usign a custom sort method you must write the code for this custom sorting method

@valtido
Copy link
Author

valtido commented Mar 20, 2014

I am just reporting my experience with it lol, I knew how to debug and fix it, but others may not be so lucky. a simple if statement to check whether or not you should call a method should be in place whether it is my wrong doing or not.

@joequery
Copy link
Owner

I would rather the plugin fail loudly if the user is attempting to use a sorting method that was not defined. Additionally, it's much easier to debug and talk about the unminified version of the plugin :P

@valtido
Copy link
Author

valtido commented Mar 21, 2014

I suppose, I used the chrome pretty print feature it just turns mins to pretty. without me having to download, and put more scripts to find out the problem. but I suppose you are right...

I guess you can close the ticket :)

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

No branches or pull requests

3 participants