php+ajax+jquery 定时刷新页面数据
testajax.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gbk" />
<title>testajax</title>
</head>
<body>
<script src='http://www.kuitao8.com/images/js/jquery-1.9.1.min.js'></script>
<script type= "text/javascript">
$(document).ready(function() {
function update() {
$.ajax({
type: 'GET',
url: 'ajax.php',
success: function(data) {
$("#timer").html(data);
//window.setTimeout(update, 1000);
},
});
}
setInterval(function(){update();}, 1000);
//update();
});
</script>
<div style="margin:80px auto;width:500px;font-size:32px;color:red;">
<div id="timer"> </div>
</div>
</body>
</html>
ajax.php
<?php
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . 'GMT');
header('Cache-Control: no-cache, must-revalidate');
include_once 'inc/conn.php';
include_once 'inc/utility2.php';
include_once 'inc/utility_all.php';
include_once 'inc/utility.php';
global $connection;
$stunum="4257330415748211";
$snum='3';
$sql = "select * from jo_reviewmsg where pnum='{$stunum}' and snum='{$snum}' and status='2' order by id desc limit 1";
$result=mysql_query($sql,$connection);
if($row=mysql_fetch_array($result)){
$flag=$row['flag'];
$reason=$row['reason'];
$retstr=$flag.$reason;
}
else
$retstr='';
date_default_timezone_set("Asia/Shanghai");
echo date("Y-m-d H:i:s")." ret=".$retstr;
?>
php+ajax+jquery 定时刷新页面数据的更多相关文章
- Ajax实现定时刷新页面
function deleteValue(){ var refresh = function() { $.ajax({ type:'post', url:'/Application/index ...
- .net MVC中使用angularJs刷新页面数据列表
使用angularjs的双向绑定功能,定时刷新页面上数据列表(不是刷新网页,通过ajax请求只刷新数据列表部分页面),实例如下: @{ Layout = null; } <!DOCTYPE ht ...
- Ajax 实现无刷新页面
注意:如本文所用,在前面的文章库的数目可以在源代码中找到,我将指示在文本,其中链路,为了缩短制品的长度,阅读由此带来的不便.乞求被原谅. 评论文章 Ajax 实现无刷新页面.其原理.代码库.代码. 这 ...
- Angular 定时器$timeout和$interval关于定时刷新页面和发送请求的用法
项目中有用到定时器定时刷新页面的数据,在网上查看了一些资料,整理了一下,备忘. $timeout 用法如下:$timeout(fn,[delay],[invokeApply]); fn:一个将被延迟执 ...
- JS定时刷新页面及跳转页面
JS定时刷新页面及跳转页面 Javascript 返回上一页1. Javascript 返回上一页 history.go(-1), 返回两个页面: history.go(-2); 2. history ...
- JSP简单练习-定时刷新页面
<%@ page contentType="text/html; charset=gb2312" %> <%@ page import="java.ut ...
- Python3.x:定时获取页面数据存入数据库
Python3.x:定时获取页面数据存入数据库 #间隔五分钟采集一次数据入库 import pymysql import urllib.request from bs4 import Beautifu ...
- 【jQuery】: 定时刷新页面
<%@page import="qflag.ucstar.seatmonitor.manager.SeatMonitorManager"%><%@ page la ...
- jQuery 使用ajax,并刷新页面
<script> function del_product_information(id) { $.ajax({ url: "{% url 'del_product_inform ...
随机推荐
- HQL查询中取个别几个字段
数据表:
- poj2195
题解: 简单KM 把每一个男的和房子分离 代码: #include<cstdio> #include<cmath> #include<algorithm> #inc ...
- LeetCode OJ:Palindrome Partitioning(回文排列)
Given a string s, partition s such that every substring of the partition is a palindrome. Return all ...
- SpringInAction--自动化装配Bean(隐式装配)
关于Bean的介绍就具体不多介绍了,,, Spring在配置时候有三种方案可选 1.在xml中进行显示配置 2.在java中进行显示配置 3.隐式的Bean发现机制和自动装配 今天学习的就是自动化装配 ...
- L160
In the Soviet Union several cases have been reported recently of people whocan read and detect colou ...
- JSP里的<c:if>不起作用[待解答]
JSP页面的部分代码如下: 下面的title作为请求参数,shoppingCart作为session范围域的属性. 问题1: 如果去掉<c:if>的判断条件,第一行打印:可以正常显示出来, ...
- RHCS高可用集群配置(luci+ricci+fence)
一.什么是RHCS RHCS是Red Hat Cluster Suite的缩写,也就是红帽集群套件,RHCS是一个能够提供高可用性.高可靠性.负载均衡.存储共享且经济廉价的集群工具集合,它将集群 ...
- Linux系统中DHCP的配置
DHCP为动态主机配置协议,负责IP地址的动态分配(当一个主机的IP为自动,则不需要自己写IP,他会在DHCP服务器的范围内自动获取) 在真机或虚拟机下配置DHCP服务时,需要先下载dhcp软件,使用 ...
- 将安防IPC摄像机进行类似于萤石/乐橙/360水滴模式的互联网直播的几种方案
前言 在维护EasyDarwin开源项目的几年内,几乎市面上大大小小的技术需求都给接触了一遍,大团队.大背景有大需求,草根团队有草根团队的需求,然而这些需求近些年都有一个发展的趋势,那就是" ...
- couldn't import dot_parser
这个错误,你不要信它,实际可以画图了.害我又降级安装,真是气死了.