if (root.dataset) { avalon.fn.data = function (name, val) { name = name && camelize(name) var dataset = this[0].dataset switch (arguments.length) { case 2: dataset[name] = val return this case 1: val = dataset[name] return parseData(val) case 0: var ret = createMap() for (name in dataset) { ret[name] = parseData(dataset[name]) } return ret } } }