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. 执行Maven install或Maven test命令时控制台输出乱码的解决办法

    [解决方案一] 在Maven的pom.xml文件中增加如下代码: <properties> <argLine>-Dfile.encoding=UTF-8</argLine ...

  2. yii控制布局方式

    1:在控制器内成员变量设置 public $layout = false; //不使用布局 public $layout = “main”; //设置使用的布局文件 2:在控制器成员方法内设置 $th ...

  3. 【MySQL】CSV 文件导入MySQL

    此问题是前几天整理数据的时候碰到的,数据存在 CSV文件中(200多万记录),通过python 往数据库中导入太慢了,后来使用MySQL 中自带的命令 LOAD DATA INFILE, 30多秒就能 ...

  4. C# 设计模式巩固 - 抽象工厂模式

    前言   继续工厂模式高级版,抽象工厂模式.抽象工厂模式其实是从工厂方法模式拓展而来.在实际的生活中一个工厂的产品不可能是单一的,肯定是多种系列的产品. 介绍 - 抽象工厂模式 定义:(摘自百度百科~ ...

  5. lambda表达式 <二>

    概念了解: 1.什么是匿名委托(匿名方法的简单介绍.为什么要用匿名方法) 2.匿名方法的[拉姆达表达式]方法定义 3.匿名方法的调用(匿名方法的参数传递.使用过程中需要注意什么) 什么是匿名方法? 匿 ...

  6. 缓存LruCache简单创建和使用

    LruCache一般使用: /** * 总容量为当前进程的1/8,单位:KB * sizeOf():计算缓存对象的大小,单位要一致 * entryRemoved():移除旧缓存时调用 */ int m ...

  7. 【WebGL】1.WebGL简介

    OpenGL和WebGL基本概念 OPEN GL:一个跨编程语言.跨平台的编程接口规格的专业的图形程序接口.它用于三维图像(二维的亦可),是一个功能强大,调用方便的底层图形库. WebGL:›一个3D ...

  8. Linux虚拟机基本操作

    ---恢复内容开始---  一.输入法调整 实现步骤:Application ------> System Tools ------>Settings ------>Rejion&a ...

  9. AS3帮助手册

    http://help.adobe.com/zh_CN/FlashPlatform/reference/actionscript/3/index.html

  10. Apache .htaccess文件

    今天在将ThinkPHP的URL模式由普通模式(URL_MODE=1)http://localhost/mythinkphp/index.php/Index/user/id/1.html改为重写模式 ...