Why can't I update the data returned by PHP in js?
Source: Internet
Author: User
Why can't I update the data returned by PHP referenced in js? The following code is a timer in JS, which assigns the latest value retrieved by PHP in the database to the variable ads in & nbsp; js and then pops up, then the same process is executed every five seconds, but the value popped up later is not the latest value. In fact, the data has been updated. why? & Lt ;? Phpheader (Content-type: & nbsp; text js references the data returned by PHP. why not update it by yourself?
The following code is a timer in JS, which assigns the latest value retrieved by PHP in the database to the variable ads in js and then pops up, then the same process is executed every five seconds, but the value popped up later is not the latest value. In fact, the data has been updated. why?
Header ("Content-type: text/html; charset = utf-8 ");
Date_default_timezone_set ('prc ');
Include "btcconn. inc. php ";
$ Pdo = new PDO ($ dsn, $ user, $ password, $ options );
?>
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.