Next I'm trying to return a database value via Ajax.
By clicking the button:
<button id="btn-database-finder" name="database-link" type="button" class="btn btn-outline btn-primary btn-xs btn-to-right" data-toggle="modal" data-target="#databaseModal">Visualizar</button>
It goes to Ajax:
$("#btn-database-finder").on("click",function(){
var radioid = $('#id-viewer').html();
$.ajax({
type:"post",
url:"../connect/post/select.php",
data:'database-link='+radioid,
success:function(responseData, textStatus, jqXHR, data){
$("#database-viewer").html('<a href=../dashboard/dist/archives/databases/'+data+'><i class="fa fa-file-archive-o fa-5x" aria-hidden="true" style="cursor: pointer;"></i></a>');
}
});
});
What's in the box:
<i class="fa fa-hashtag" id="id-viewer" aria-hidden="true"></i>
Where is the ID within the TAG li .
In this part everything is working, putting alert () appears ID , but when it goes to url:"../connect/post/select.php",
What is:
if($_SERVER['REQUEST_METHOD']=='POST'){
$stDatabase = $_POST['database-link'];
$sendDatabase = $selDatabase->selectDatabase($stDatabase);
exit();
}
It always returns the as undefined:
<a href="dashboard/dist/archives/databases/undefined"><i class="fa fa-file-archive-o fa-5x" aria-hidden="true" style="cursor: pointer;"></i></a>