Permalink
Browse files

Merge pull request #262 from lovasoa/patch-1

replace .html() with .text()
  • Loading branch information...
2 parents 34b52fc + 010b34a commit a44de040c2bda223fbdb39efb69f6ec95dd7cc07 @zaach committed Aug 18, 2015
Showing with 5 additions and 5 deletions.
  1. +5 −5 assets/js/try.js
View
@@ -6,12 +6,12 @@ var parser,
//IE, mainly
if(typeof console === 'undefined'){
console = {};
- console.log = function (str) {$("#out").html(uneval(str))};
+ console.log = function (str) {$("#out").text(uneval(str))};
}
// noop
print = function (){}
-var printOut = function (str) { $("#out").html(str); };
+var printOut = function (str) { $("#out").text(str); };
$(document).ready(function () {
$("#process_btn").click(processGrammar);
@@ -38,7 +38,7 @@ function processGrammar () {
try {
var cfg = bnf.parse(grammar);
} catch (e) {
- $("#gen_out").html("Oops. Make sure your grammar is in the correct format.\n"+e).addClass('bad');
+ $("#gen_out").text("Oops. Make sure your grammar is in the correct format.\n"+e).addClass('bad');
return;
}
}
@@ -49,9 +49,9 @@ function processGrammar () {
$("#out").removeClass("good").removeClass("bad").html('');
$("#gen_out").removeClass("good").removeClass("bad");
if (!parser.conflicts) {
- $("#gen_out").html('Generated successfully!').addClass('good');
+ $("#gen_out").text('Generated successfully!').addClass('good');
} else {
- $("#gen_out").html('Conflicts encountered:<br/>').addClass('bad');
+ $("#gen_out").text('Conflicts encountered:\n').addClass('bad');
}
$("#download_btn").click(function () {

0 comments on commit a44de04

Please sign in to comment.