I have the following code which is part of a comment form in a page.
$.ajax({
type: "POST",
url: "path/to/script.php",
data: $(form).serialize(),
success: function(data) {
$('#comment_form').fadeOut(1000);
var url = 'path/to/script.php';
$('#commenti').load(url + ' .comment');
}
});
On server side all characters like <
and >
get stripped but i need them to allow displaying code snippets inside the <code></code>
tags.
Is there any way with jquery to convert the <
to <
and >
to >
before submitting so the comments will display without stripped characters?