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

Is it better to using 'key = elem.attr("data-localize");'? #69

Open
JiYouMCC opened this issue Mar 3, 2016 · 0 comments
Open

Is it better to using 'key = elem.attr("data-localize");'? #69

JiYouMCC opened this issue Mar 3, 2016 · 0 comments

Comments

@JiYouMCC
Copy link

JiYouMCC commented Mar 3, 2016

In line L98

The scenario is that there a element's data-localize will change by js.
Then doing localize will cause issue

example:

var a = $("<div></div>").attr("data-localize", 1);
 > undefined
a
 > [<div data-localize=​"1">​</div>​]
a.data()
 > Object {localize: 1}

if change the attr data-localize

a.attr("data-localize", 2)
 > [<div data-localize=​"2">​</div>​]
a.data()
 > Object {localize: 1}
a.attr("data-localize")
> "2"

Now I use workaround in my repository. The workaround seems so ugly...

$("#....").data("localize", newValue).attr("data-localize", newValue)

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

1 participant