سلام
اینم جواب تمرین
<script>
$(document).ready(function()
{
$('#addbtn').click(function(e)
{
var input = $('#addinput');
$.ajax
({
url:'process/ajax-handler.php',
method:'post',
data: {action:"addFolder", Foldername:input.val()},
success: function(data)
{
if (data=='1')
{
var Folderid=data[0].id;
var FolderName=data[0].Name;
var folderRow = "<a href='?folder=id="+ Folderid+"'><i class='fa fa-folder'></i>"+FolderName+"</a>"+
"<a class='remove' href='?Delete_folder"+ Folderid+"' >x</a>"
$(folderRow).append('ul.folder_list');
}else
{
alert(data);
}
}
});
});
});
</script>