i\'m creating a plugin in which the user adds custom settings in data- attribute in HTML. Settings are in JSON format. I\'m using these settings in Javascript.<
data-
You need to escape data and handle special characters.
<div data-side="front" data-params="<?php echo htmlspecialchars(json_encode($dataParams), ENT_QUOTES, 'UTF-8'); ?>">
And get it with jQuery:
$('[data-side="front"]').data('params'); // object