$("#btn_validate").click( function () {
$("#warnings").html("");
$("#errors").html("");
$("#results").html("");
validate($("#ta_turtle").val(), function (feedback) {
$.each(feedback.warnings, function (index, warning) {
$("#warnings").append($('
').text(warning));
});
$.each(feedback.errors, function (index, error) {
$("#errors").append($('').text(error));
});
if (feedback.errors.length === 0 && feedback.warnings.length === 0) {
$("#results").append("Congrats! Your syntax is correct.");
}
});
});