ajax局部刷新一个div下的jsp
用AJAX刷新一个DIV中的jsp内容
<script type="text/javascript">
var xmlhttp;
function startrefresh(){
xmlhttp=new XMLHttpRequest();
xmlhttp.open("POST,"ss.jsp",true);
xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
//xmlhttp.send("name=wk"); --需要传输参数时增加
xmlhttp.onreadystatechange = function(){
if(xmlhttp.readyState == 4)
if(xmlhttp.status == 200)
document.getElementById("mydvi").innerHTML=xmlhttp.responseText;
}
}
</script>
如果让这个div自动刷新的话,可以用setInterval('startrefresh()',5000),这个函数的作用是每隔5秒自动执行一次startrefresh方法,还有一种方法是setTimeout('startrefresh()',5000),但是这个方法只会执行一次。
ajax局部刷新一个div下的jsp的更多相关文章
- ajax局部刷新
//5秒刷新一次 $(function () { setInterval(Refresh, 5000); }); //ajax局部刷新 function Refresh() { $.ajax({ ty ...
- php Ajax 局部刷新
php Ajax 局部刷新: HTML部分 </head> <body> <h1>Ajax动态显示时间</h1> <input type=&quo ...
- Ajax局部刷新(使用JS操作)
对于在不使用Ajax的情况下,使用JS来进行局部刷新,主要有如下的几步: 1. 得到XMLHttpRequest 2. 使用open方法打开连接 3. 设置请求头信息 4. 注册onreadystat ...
- Ajax 局部刷新 异步提交
AJAX简介 局部刷新,异步提交. AJAX 不是新的编程语言,而是一种使用现有标准的新方法.它最大的有点就是在不重新加载整个页面的情况下,可以与服务器交换数据并更新部分网页内容. 浏览器朝后端发送请 ...
- thickbox关闭子页后ajax局部刷新父页
1. 首先注意需要调用thickbox的js <script type="text/javascript" src="<%=path%>/js/jque ...
- 实现AJAX局部刷新以及PageMethod方法的使用
<html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> &l ...
- 用户登录ajax局部刷新验证码
用户登录的时候,登录页面附带验证码图片,用户需要输入正确的验证码才可以登录,验证码实现局部刷新操作. 效果如图: 代码如下: #生成验证码及图片的函数 newcode.py import rando ...
- Ecshop ajax 局部刷新购物车功能
1.比如我们category.dwt 里有 <a href='flow.php'><SPAN id='cart_count_all'>{insert name='cart_in ...
- 获取一个div下的li或者img元素
上层div的xpath=//*[@id="launchpadOptionsList"] 其下的所有li的最后一个是//*[@id="launchpadOptionsLis ...
随机推荐
- python opencv3 摄像头人脸检测
git:https://github.com/linyi0604/Computer-Vision # coding:utf8 import cv2 def detect(): # 创建人脸检测的对象 ...
- Pipeline和FeatureUnion
注:本文是人工智能研究网的学习笔记 Pipeline:chaining(链接)estimators Pipeline可以用于把多个estimators级联合成一个estimator.这么做的原因是考虑 ...
- 【Codeforces 498B】 B. Name That Tune (概率DP)
B. Name That Tune time limit per test 1 second memory limit per test 256 megabytes input standard in ...
- centOS7.4服务器 yum安装 搭建lamp环境
// 红色加粗是linux命令 安装gcc和gcc-c++ yum -y install gcc gcc-c++ yum list httpd* 安装apche yum -y install http ...
- BZOJ 3876: [Ahoi2014]支线剧情 带下界的费用流
3876: [Ahoi2014]支线剧情 题目连接: http://www.lydsy.com/JudgeOnline/problem.php?id=3876 Description [故事背景] 宅 ...
- Codeforces Round #354 (Div. 2) E. The Last Fight Between Human and AI 数学
E. The Last Fight Between Human and AI 题目连接: http://codeforces.com/contest/676/problem/E Description ...
- Codeforces Round #352 (Div. 1) B. Robin Hood 二分
B. Robin Hood 题目连接: http://www.codeforces.com/contest/671/problem/B Description We all know the impr ...
- c++ 常见网络协议头
//NTP协议 typedef struct _NTP_HEADER { uint8_t _flags;//Flags 0xdb uint8_t _pcs;//Peer Clock Stratum u ...
- IIS7.5 配置 PHP 5.3.5
本机环境:IIS7.5 windows2008 64位 首先确认IIS中启用了CGI功能: watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQveWVmaWdod ...
- Bootstrap 3之美05-排版、Button、Icon、Nav和NavBar、List、Table、Form
本篇主要包括: ■ 排版■ Button■ Icon■ Nav和NavBar■ List■ Table■ Form 排版 ● 斜体:<em>● 加粗体:<strong& ...