score:1

you need to properly escape the string that goes into the data-plugin-options attribute. more info: https://stackoverflow.com/a/9189067/1869660

formatter: function () {
    function escapeattr(str) {
        var div = document.createelement('div');
        div.setattribute('data-dummy', str);
        return /\"(.*)\"/.exec(div.outerhtml)[1];
    }

    var options = { type: 'iframe'},
        optionsattr = escapeattr(json.stringify(options));

    return '<div class="label">'
         +   '<a class="lightbox" href="http://www.google.com" data-lightbox="iframe" data-plugin-options="' + optionsattr + '">icon</a>'
         + '</div>';
},

http://jsfiddle.net/g6yehxeo/

you can also use the built-in escape() method instead of our homemade escapeattr(), but then whoever reads the attribute later needs to unescape() the value first to get valid json.


Related Query

More Query from same tag