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 定时刷新页面数据的更多相关文章

  1. Ajax实现定时刷新页面

    function deleteValue(){ var refresh = function() { $.ajax({   type:'post',   url:'/Application/index ...

  2. .net MVC中使用angularJs刷新页面数据列表

    使用angularjs的双向绑定功能,定时刷新页面上数据列表(不是刷新网页,通过ajax请求只刷新数据列表部分页面),实例如下: @{ Layout = null; } <!DOCTYPE ht ...

  3. Ajax 实现无刷新页面

    注意:如本文所用,在前面的文章库的数目可以在源代码中找到,我将指示在文本,其中链路,为了缩短制品的长度,阅读由此带来的不便.乞求被原谅. 评论文章 Ajax 实现无刷新页面.其原理.代码库.代码. 这 ...

  4. Angular 定时器$timeout和$interval关于定时刷新页面和发送请求的用法

    项目中有用到定时器定时刷新页面的数据,在网上查看了一些资料,整理了一下,备忘. $timeout 用法如下:$timeout(fn,[delay],[invokeApply]); fn:一个将被延迟执 ...

  5. JS定时刷新页面及跳转页面

    JS定时刷新页面及跳转页面 Javascript 返回上一页1. Javascript 返回上一页 history.go(-1), 返回两个页面: history.go(-2); 2. history ...

  6. JSP简单练习-定时刷新页面

    <%@ page contentType="text/html; charset=gb2312" %> <%@ page import="java.ut ...

  7. Python3.x:定时获取页面数据存入数据库

    Python3.x:定时获取页面数据存入数据库 #间隔五分钟采集一次数据入库 import pymysql import urllib.request from bs4 import Beautifu ...

  8. 【jQuery】: 定时刷新页面

    <%@page import="qflag.ucstar.seatmonitor.manager.SeatMonitorManager"%><%@ page la ...

  9. jQuery 使用ajax,并刷新页面

    <script> function del_product_information(id) { $.ajax({ url: "{% url 'del_product_inform ...

随机推荐

  1. 解决SecureCRT下spark-shell中scala无法删除问题

    转自:http://blog.csdn.net/huanbia/article/details/51318278 问题描述 当使用SecureCRT来打开Spark-shell的时候,有时会出现如下问 ...

  2. 从工程角度看C++观察者模式中的接口是否需要提供默认的实现

    在C++中,我们会经常用到观察者模式(回调模式,Delegate模式等,意思都一样),比如当Source中的某个参数发生了变化时,我们通过观察者模式进行回调通知,下面是一个例子: class Sour ...

  3. Centos7 使用Dockerfile 制作自己的Dotnetcore程序镜像

    准备Centos7环境及Docker环境 从Docker hub拉取 Microsoft/dotnet 基础镜像(可以使用国内加速) 向Centos7指定目录上传Dotnet Core程序,目录: / ...

  4. 网页宽高clientWidth clientHeight获得数值不对的问题

    当网页内容撑不满一屏时,通过以下代码获得整个网页高度会有问题 document.body.clientHeight;document.body.clientWidth; 得到的宽高不对,可能是因为ht ...

  5. WIFI 基础知识

    转载自:wifi基本知识 如侵犯您的版权,请联系:2378264731@qq.com 1. IE802.11简介 标准号 IEEE 802.11b IEEE 802.11a IEEE 802.11g ...

  6. LINUX系统下的shell命令---grep、sed、awk

    1)grep文本过滤命令 1.grep基本认识 (Global  search  regular expression and  print  out the  line全局搜索研究正则表达时并显示出 ...

  7. LINUX中的DNS服务---高速缓存DNS

    一.什么是DNS     Domain Name System,域名系统.     万维网上作为域名和IP地址相互映射的一个分布式数据库,能够使用户更方便的访问互联网.他主要负责把域名和IP的相互转换 ...

  8. 【PL/SQL编程】块结构

    [DECLARE] --声明部分,可选 BEGIN --执行部分,必须 [EXCEPTION] --异常处理部分,可选 END

  9. 利用 squid 反向代理提高网站性能(转载)

    本文在介绍 squid 反向代理的工作原理的基础上,指出反向代理技术在提高网站访问速度,增强网站可用性.安全性方面有很好的用途.作者在具体的实验环境下,利用 DNS 轮询和 Squid 反向代理技术, ...

  10. Linux基础二(修改ip地址、修改网关、修改DNS服务器、重新启动网络配置)

    网络的初始化 .ip地址的修改(临时生效) 使用ifconfig命令 ifconfig 网卡名 ip地址 netmask 子网掩码 [root@localhost /]# ifconfig eth1 ...