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

.attr is not a function #23

Open
dave-worley opened this issue May 16, 2012 · 4 comments
Open

.attr is not a function #23

dave-worley opened this issue May 16, 2012 · 4 comments

Comments

@dave-worley
Copy link

using the following code:

        $(".cat-btn").bind "click", (e) ->
            log $(e.source).attr("id")

results in the following error when the .cat-btn is clicked:

[WARN] Exception in event callback. {
line = 59;
message = "'undefined' is not a function (evaluating '$(e.source).attr("id")')";
name = TypeError;
sourceId = 247376960;
}

I'm running the titanium sdk version 2.0 with Kranium v. 0.1.4

@dave-worley
Copy link
Author

I also just tried this on the kranium 0.2 branch to the same result.

@krawaller
Copy link
Owner

From just a quick look, my guess is that it is the log function that is undefined, not attr. Is there really a global function called 'log' in your context? Perhaps you meant to write console.log?

(written by David, not Jacob)

@dave-worley
Copy link
Author

Yes, there's a log function in scope.

If you take a look at the error message it explains the statement it's evaluating. The .attr function, in any context we've used it, is undefined.

@krawaller
Copy link
Owner

Absolutely right. Should have turned on brain before polluting the internet. Sorry! :)

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

2 participants