<div class="grid--cell fl1 lh-lg">
<div class="grid--cell fl1 lh-lg">
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, <a href="/help/reopen-questions">visit the help center</a>.
</div>
</div>
</div>
<div class="grid--cell mb0 mt8">Closed <span title="2012-11-18 18:41:45Z" class="relativetime">7 years ago</span>.</div>
</div>
</aside>
I have been trying to figure out a way to load something in PHP only when the page has been fully loaded.
What I have is:
echo "
<td colspan='5'>
<div id='div".$x."' class='targetDiv' style='visibility: hidden'>
<center>".load($data['download_url']);"</center>
</div>
";
I need the .load bit to only be inserted or initialized when the rest of the page is fully loaded. I'v read ways of doing this with jQuery and Ajax, but couldn't make them work.
</div>
There is no way to do such a thing, without AJAX. Check jQuery ajax function, it has full and simple documentation.
Anyway, you have to write something like this (there are some pretty bad practices, but it's only for example):
<script>
$(document).ready(function() {
$.ajax({
url: 'http://yoursite.com/yourpage.php',
success: function(data) {
$('#paste-result-here').html(data);
}
});
});
</script>
<table>
<tr>
<td id="paste-result-here"></td>
</tr>
</table>
And php yourpage.php:
echo "
<div id='div{$x}' class='targetDiv' style='visibility: hidden'>
<center>{$data['download_url']}</center>
</div>
";