ajaxorg/ace — Issue #519: How to load html tags in the editor area
Author: lauthiamkok
Created: 2011-11-20 04:03:30+00:00
State: open

I am current using ace to display code in an textarea, but I can't make it to display html tag when it is loaded,

html,

jquery + ace,

$(document).ready(function(){

var editor = ace.edit("ace-editor");
editor.setTheme("ace/theme/eclipse");

var XmlMode = require("ace/mode/xml").Mode;
editor.getSession().setMode(new XmlMode());

//var textarea = $('.code').hide();
var textarea = $('.code');

// Get the value from the editor and place it into the texrarea.
var text = editor.getSession().getValue();
textarea.val(text);

// Update the textarea on change.
editor.getSession().on('change', function(){

// Get the value from the editor and place it into the texrarea.
var text = editor.getSession().getValue();
textarea.val(text);
//alert(text);
});

$('#form_data').submit(function(e){
//alert($(this).serialize());

var object = $(this);
var path = object.attr('action');

$.post(path, object.serialize(),function(xml){

});
return false;
});
});

It should display the html tags below,

But it only display numbers of lines.

How can I fix this?

Here is the page - http://lauthiamkok.net/dump/ace/editor_2.html I have put them all together.