So I have this problem, where I have a database-client, and the way it is right now, is that when the page loads, it generates sections for every row in a database table containing a domain name, and the corresponding IP-address for it with PHP.
On top of that, I have a "additional information" -button, that loads information from a php whois -API site, which scans the corresponding address and returns all whois -information about that site (creation date, expiration date, etc.)
So I would like to change this system from a button to a instantenous system, but can't seem to be able.
I think the problem lies in the page trying to load all the scripts before it get the information
//This is the Jquery for the button press, which loads the additional information
$(document).ready(function showresult(){
$(".showinfo").click(function(){
site = ($(this).closest('.row').find('li:first').text());
$('.result').load('http://localhost/database/phpwhois-4.2.2/whois.php?query='+site+'&output=nice #result ');
$('.result').show();
$('.hideinfo').show();
$('.showinfo').hide();
});
});
And then the PHP
print "<div class='row'>";
print "<li class='names'>".$row['name']."</li>";
print "<li class='add'>".$row['add']."</li>";
print "<br><br>";
print "<div class='addinfo'>
<button class='showinfo'>More information </button>
<div class='result'>
</div>
";
EDIT
So the thing I tried, that didn't work was something in the lines of
$(document).ready(function(){
setTimeout(showinfo, 1000);
}
function showinfo(){
site = ($(this).closest('.row').find('li:first').text());
$('.result').load('http://localhost/database/phpwhois-4.2.2/whois.php?query='+site+'&output=nice #result ');
$('.result').show();
$('.hideinfo').show();
$('.showinfo').hide();
});
});