This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// preview with hilight.js and pretty json format | |
$('[name="json_data"]').on('input change', function () { | |
let previewWrapper = $(this).siblings('.preview-wrapper'); | |
const $code = previewWrapper.find('pre > code'); | |
if ($(this).val()) { | |
try { | |
var val = JSON.parse($(this).val()) | |
} catch (e) { | |
$(this).addClass("warning-bordered"); | |
return false; |