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

Problems with fetching link data via jquery.data method #35

Closed
kirkbushell opened this issue Feb 7, 2012 · 7 comments
Closed

Problems with fetching link data via jquery.data method #35

kirkbushell opened this issue Feb 7, 2012 · 7 comments

Comments

@kirkbushell
Copy link

Hi Nathan!

I tried using your library today in combination with formtastic and I had a number of problems - all related to the data method. For some reason - whenever I queried manually for the a data attributes, they would always returned nil - which made your library almost useless. I updated the javascript so that it uses $.attr('data-whatever') instead and now it works fine.

If you like I can provide this update - which I don't particularly like as data should have worked, but it seems to be a problem?

@nathanvda
Copy link
Owner

The jquery data method is standard in the latest jqueries, it was added in version 1.4.3. If you check #20, they give the same error, and that was related to active_admin having a hard dependency on jquery 1.4.2 (which is ancient). So are you using active_admin as well?

@kirkbushell
Copy link
Author

Yeah - actually we are, but this has nothing to do with the admin. I checked our jquery version - it's 1.7.1. Note that the issue I'm having isn't with the data() method itself (which would throw an error), but what it returns. Also we have other dependencies in the project that require jQuery 1.6+

@nathanvda
Copy link
Owner

Ok, it was just a striking ressemblance. In an older version of active_admin the jquery was vendored. Also note that the .data did not throw a an error, but returned nil, exactly what you describe.

But if you are not using that version of active_admin I am afraid I do not know what could cause the .data() method to refrain from operating correctly.

@kirkbushell
Copy link
Author

nathan - hmmm, odd indeed. I'll do some more investigation and see if activeadmin is interfering in another way. I know the right jquery is being loaded but perhaps activeadmin is loading it again elsewhere?

@nathanvda
Copy link
Owner

Do you have any update on this?

@kirkbushell
Copy link
Author

Still not sure what was going on. data() method should have been supported and yet it wasn't - yet it works fine for all our custom code =\

@nathanvda
Copy link
Owner

Ok. Not really solved, but as far as I can tell: for now a bit unsolvable. So I close this 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

2 participants