There are pages of user profiles that work on the principle of get_file_content. Every time it is generated. I would not like to touch on the structure of the site and decided to do block ui with preloader.
I figured it out, but the problem arose. The page is generated on request via $id = $_GET['id']
(player.php?id=123
). The script I want to use via the preloader is in another file (stats.php), because preloader works through AJAX Post + $(document).ready(function();
, the $id
variable cannot be passed from player.php
to stats.php
) How to be in this case?
Js output + preload:
function show_stats() {
jQuery.ajax({
type:"post",
url: "stats.php",
beforeSend: function() {
$('#stats-block').block({
message: '<div class="la-ball-pulse la-dark"><div></div><div></div><div></div></div>',
css: {
border: 'none',
backgroundColor:'transparent'
}
});
},
success: function(data) {
$('.chatonline').show();
$('#stats-block').unblock();
$('#stats-moders').html(data);
},
});
}