You can use eval() to convert a JSON string to an actual JS object.
However, from my test , you need to make sure that the property names are specified (ie "varname": "value" instead of varname: "value" ).
And as @Pointy said, you can simply use the jQuery .data() method to extract the string.
So your HTML code is as follows:
<a href="something.html" data-mem='{"varname": "value", "varname2": "value"}'>Bla Bla</a>
And your Javascript will become:
var data = eval($('a').data('mem'));
The above example shows how you can use javascript features to reflect any property names.
EDIT: Updated code to show how to handle any property names.
Gregl source share