Skip to content

Added html5data methods set/get #91

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

jwestbrook
Copy link
Collaborator

Based on the issue below sethtml5data() and gethtml5data() will write to
the dataset and the write the data-* attributes correctly in any
browsers that Prototype supports.

https://prototype.lighthouseapp.com/projects/8886/tickets/250-support-for-dataset-property-and-data-attributes

Based on the issue below sethtml5data() and gethtml5data() will write to
the dataset and the write the data-* attributes correctly in any
browsers that Prototype supports.

https://prototype.lighthouseapp.com/projects/8886/tickets/250-support-for-dataset-property-and-data-attributes
//simple test for native HTML5 dataset existence
var NATIVEHTML5DATASET = (function (){
var testelement = new Element("div",{"data-test-this-thing":"test"});
if(typeof testelement.dataset != 'undefined' && typeof testelement.dataset.testThisThing != 'undefined') return true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return (testelement.dataset && testelement.dataset.testThisThing === 'test');

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

Successfully merging this pull request may close these issues.

3 participants