Answer the question
In order to leave comments, you need to log in
How to refresh a page that is rendered in php when a button is clicked?
I'm trying to create my first Drupal site... On the
left of the page there is a table of links that set the id parameter, for example, from the "site" page we get to "site/?id=1", "site/?id=2", "site/ ?id=3" and so on. It is necessary when clicking on these links, in accordance with the parameter, to update the part of the page on the right, i.e. so that the same php script that forms the block starts again. It feels like php is only running once.
How to make an update?
PS Reading with $_GET('ID') works.. You have to force the php script to execute again...
Answer the question
In order to leave comments, you need to log in
(function($)
{
$(document).ready(function()
{
$.ajaxSetup(
{
cache: false,
beforeSend: function() {
$('#content').hide();
$('#loading').show();
},
complete: function() {
$('#loading').hide();
$('#content').show();
},
success: function() {
$('#loading').hide();
$('#content').show();
}
});
var $container = $("#content");
$container.load("file.php");
var refreshId = setInterval(function()
{
$container.load('file.php');
}, 9000);
});
})(jQuery);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question