Ask for Help
“jQuery throwing a syntax error when using
is("[data-foo]")?”
Has anyone seen jQuery throw a syntax error when passing a data- attribute name to the is() function? This code often works, but started throwing a syntax error after some markup was removed and then re-inserted into the DOM:
$("#foo").attr("data-bar") = 5;
$("#foo").is("[data-bar]");
Interesting Things
- Rails 3.0.5 has been released.
- The Nordic Ruby Conference call for proposals ends today, so hurry up and submit.
- Rails Conf 2011, which is being held in my hometown of Bal-ti-more, just announced its keynote speakers. Check them out.
Shouldn’t that be :
$(“#foo”).attr(“data-bar”, 5);
I’m pretty sure what you have there doesn’t work…
March 1, 2011 at 11:28 am
Ooops, yeah I had it right when I was trying it out but failed to paste in the right code :)
March 1, 2011 at 1:29 pm