I also tried to make custom workaround. Has idea to add custom $.fn.dataHtml function with code similar to:
var data = el.getAllData();
el.html(html);
for (var key in data) {
el.data(key, data[key]);
}
But there is no way to get all stored data keys. Maybe you can modernize $.data module to not lose data, or implement method to get all stored data or data keys for element. Right now I have to modify source code of $.data module which is not very good.
I also tried to make custom workaround. Has idea to add custom $.fn.dataHtml function with code similar to:
But there is no way to get all stored data keys. Maybe you can modernize $.data module to not lose data, or implement method to get all stored data or data keys for element. Right now I have to modify source code of $.data module which is not very good.