How to use PHP to constantly refresh the content of a small div in the page? Idea: When creating a business system, there is a small code at the top of the page after the salesperson charges: & lt; div & nbsp; id = 'Money' & gt; & lt ;? = Getmoney ($ _ SESSION [user_id])? & Gt; meta & lt;/div & gt; getmoney ($ How to use PHP to constantly refresh the content of a small div on the page?
Idea: When creating a business system, after the salesperson charges fees, there is a small piece of code at the top of the page:
RMB
Getmoney ($ _ SESSION [user_id]) indicates that the user-defined function is used to retrieve the account currently logged on to the database, the receivables of the current day, $ _ SESSION [user_id]
It's a long journey.
How can we keep refreshing this small div without any assistance? Or is it automatically refreshed every one minute?
Prepare a "refresh" button and use ajax to refresh the data. What I want is to automatically refresh without interruption.
Answer questions.
------ Solution --------------------
Place an plug-in framework in it (iframe) and regularly refresh the page connected to it
------ Solution --------------------
Three methods: 1. ajax
2. put iframe on the top
3. use frameset, framework up and down, and refresh in top
------ Solution --------------------
function load()
{
$.ajax({
url:"xxx.php",
data:{"do":"load"},
success:function(d){
//$("#money").text("");
},
timeout:3000
});
}
setInterval(load,3000);
------ Solution --------------------
Reference:
Reference: setInterval is the js timer. in This timer, you can write ajax requests so that they are requested every other time. You can set the interval by yourself.
Can a cat help me write it down? This is what I want, but I won't write js ....
If you don't want to write js, use
Put it on the page once every 60 seconds and use iframe to introduce the page or the top page of the frame page