Skip to content

Issue with --data-ajax--url and jquery 1.11.2 #2969

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

Closed
loic opened this issue Jan 26, 2015 · 6 comments
Closed

Issue with --data-ajax--url and jquery 1.11.2 #2969

loic opened this issue Jan 26, 2015 · 6 comments
Milestone

Comments

@loic
Copy link
Contributor

loic commented Jan 26, 2015

--data-ajax--url is ignored while the deprecated --data-ajax-url work.

http://jsbin.com/wotamodeco/1 demonstrates the issue.

@kevin-brown kevin-brown added this to the 4.0 milestone Jan 28, 2015
@kevin-brown
Copy link
Member

Just following up on this some more based on conversations on IRC.

This appears to be a difference in how jQuery 1.x and 2.x parse the data attributes. I've created two jsbins that clearly reproduce the differences.

1.x: http://jsbin.com/zudohezome/1/edit?html,js,output
2.x: http://jsbin.com/zudohezome/2/edit?html,js,output

This is definitely a jQuery bug, as the HTML5 dataset attribute requires that the second dash is left. Here is a jsbin that confirms it: http://jsbin.com/ruratofulu/1/edit?html,js,output

kevin-brown added a commit that referenced this issue Feb 10, 2015
This adds a note about how nested data attributes do not work in
jQuery 1.x due to a bug with the `$.fn.data` method.

This is for #2969.
@kevin-brown
Copy link
Member

I added a note to the documentation about this in caeb0ec, but unfortunately it does not look like the fix will be released for jQuery any time soon. As there is not much that we can do, aside from preferring dataset when possible, I'm going to close this off once I implement the dataset check.

That will still mean that it still won't work in older browsers (IE 10 and below), but there isn't much that we can do about it.

@304NotModified
Copy link

I think there should be a workaround for this (with attributes). Or is it there already?

@onokazu
Copy link

onokazu commented Aug 2, 2015

The documentation still says that this is not supported with jQuery 1.x, or has this been resolved with the recent changes in jquery?

@kevin-brown
Copy link
Member

This is still an issue with jQuery 1.x and was not fixed in the recent 1.11.3 release.

http://jsbin.com/midenufoqa/1/edit?html,js,output

It is still fixed in the jQuery 2.x line and upcoming 3.x line.

@304NotModified
Copy link

Can't we have an alternative syntax to get it working with jquery 1.x?

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

No branches or pull requests

4 participants