Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: how can i use jquery and debug in liferay 7.4
hi
i try use a js base on jqouery to show structurenize json.
<style type="text/css">
#json-display {
border: 1px solid #000;
margin: 0;
padding: 10px 20px;
}
</style>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script type="text/javascript" src="./dist/jquery.json-editor.min.js"></script>
<script>
window.renderJson = function (targetJson) {
alert('2');
alert(targetJson);
try {
var editor = new JsonEditor('#json-display', JSON.parse(targetJson));
editor.load(JSON.parse(targetJson));
} catch (ex) {
alert(ex);
}
}
</script>
but when i trigger it, it shows
ReferenceError: JsonEditor is not defined
i do not know how to tracing the issue or debug, any suggestion?
thanks in advance
jQuery is disabled by default. For 7.4 turn it on in Control Panel > System Settings > Third Party > jQuery
Hope this helps.
thank you very much, i will try it out and feedback the result
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™