Reputation: 75
So basically i want to reload page every second and the page needs a get option so its loading the page like page.php?id=123
My code:
function autoRefresh_div(data){
$("#refreshbtn").load($.get("btn.php"));
}
setInterval('autoRefresh_div()', 1000);
Upvotes: 2
Views: 72
Reputation: 2455
You can try this to get data with id:
function autoRefresh_div(id){
$("#refreshbtn").load($.get("btn.php?id="+id));
}
setInterval(function(){
autoRefresh_div(123);
}, 1000);
Upvotes: 3
Reputation: 668
setInterval(function() {
window.location = 'page.php?id=123';
}, 1000);
Upvotes: 2