I'm working on a wordpress plugin that manages a database. The database has a table that has the id field name and descr. I have a php file that has two buttons, one and another rule change. When you click on the switch, the button triggers a javascript event that produces an ajax request cleaning a div and puts the contents of about.php Archiving
File ajax.js
$.ajax({
type: "POST",
url: "http://localhost/project/wp-content/plugins/admin/about.php",
data: {"id":id},
success: function(data)
{
$("#admin div").empty();
$("#admin div").append(data);
}
});
File about.php
<?php
$descr = $_POST['id']
$html = "<div>".wp_editor('','textarea', array('textarea_name' => $descr, 'media_buttons' => false))."</div>";
echo $html;
?>
In the file there is about one textarea I implement the wp_editor, however when ajax returns the contents of the textarea about.php looks like this:
How do I bring the features of textarea along with the buttons via ajax?