<script type="text/javascript">
function showUser(selectType) {
alert(selectType);
if (selectType == "") {
document.getElementById("selectType").innerHTML = "";
return;
}
if (window.XMLHttpRequest) {
// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp = new XMLHttpRequest();
} else {
// code for IE6, IE5
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
document.getElementById("selectType").innerHTML = xmlhttp.responseText;
}
}
xmlhttp.open("POST", "/datacenter/analysisBLOAction.action?selectType="
+ selectType, true);
xmlhttp.send();
}
function checkSelectType(selectType) {
window.location.href = "/datacenter/analysisBLOAction.action?selectType="
+ selectType;
}
</script>
上面checkSelectType这个方法其实可以点击Struts2<s:select>标签中的选项之后,能够异步的更新数据,此方法也可以和window.location.reload()同用,当然加上这个方法之后会重新加载页面也就是刷新了...
还有一段无刷新定时执行的脚本:
<html>
<head>
<script src="./jquery-1.7.1.min.js"></script>
<script>
$(document).ready(function () {
setInterval("startRequest()",1000);
});
function startRequest()
{
$("#date").text((new Date()).toString());
}
</script>
</head>
<body>
<div id="date"></div>
</body>
</html>
分享到:
相关推荐
使用[removed].reload;...window.opener.location.href=window.opener.location.href; window.opener.location.reload(); 这种写法就不出现那讨厌的对话框啦! 介绍JS实现刷新iframe的方法 <iframe src=”1.ht
window.opener.location.... 但[removed].Reload 如果有数据提交的动作,会提示是否提交的(是和否选项) window.opener.location.href=window.opener.location.href 是定向url提交数据,则不会出现是和否 的选择框。
SpringBoot使用Thymeleaf模板展示数据,里面包括详细的文档注释,包括一部分Mybatis代码,RestFull风格的链接,demo比较小,等下一步就是写个稍微大一点的项目整合Mybatis+RestFull。
javascript 取Url参数和去掉字符串前后空格方法,非常实用
本程序能够判断可执行程序是Win32的还是AMD64的, 其原理是读取二进制,判断其中几个字节的数据
自己学习中收集整理的技术文档,文章来源互联网,本文档只...window.location.href在firefox中不兼容的解决办法 ASP.NET 2.0中合并 GridView 的表头单元格 创建表头固定,表体可滚动的GridView VS2005常用快捷键 ...
基于JavaScript的洪涝监测系统源码.zip 使用ant desgin完成项目前端页面 其中,将mock服务器关闭,使用fetch实现跨域session请求等, 后台使用springmvc接收数据 链接跳转以window.location.href方式前端跳转
它使用JSON-Patch进行数据更新,并使用Operational Transformation进行版本控制和数据一致性。 它通过HTTP或WebSocket或两者运行。 实现。 /** * Defines a connection to a remote PATCH server, gives an object ...
// Browser.execClientScript("window.location.href='../ExcelFile/downloadfile.jsp?filename=" // + destFile + "';"); } catch (Exception e) { e.printStackTrace(); } } public String ...
每每听到客户抱怨自己修改和很久的数据由于自己的一个误操作而丢失时,总想让web页面也有像window窗体一样具有提示保存的功能。所以,经过一段时间的研究以后终于实现了这个功能!============ ...
查看网页源代码 onclick="window.location = "view-source:"+ "http://www.csdn.net/""> 关闭输入法 自动全选 <input type=text name=text1 value="123" onfocus="this.select()"> ENTER键可以让光标移到下...
<br/>%\> \< \a href="javascript:window.location.href='<\%=first%\>'" class="List_operatelink"\>首页\ \<\a href="javascript:window.location.href='<\%=next%\>'" class="List_operatelink"\>下...
[removed].href 或者 location.href 或者 [removed] 获得地址栏中的所有内容 decodeURI()可以解码地址栏中的数据 恢复中文数据 window.search 获得地址栏中问号及问号之后的数据 //获取地址栏里(URL)传递的参数 ...
e.item.Attributes.Add("ondblclick", "location.href=’../ShippedGrid.aspx?id=" + OrderItemID + "’"); } 双击表格打开新一页 if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ...
e.item.Attributes.Add("ondblclick", "location.href='../ShippedGrid.aspx?id=" + OrderItemID + "'"); } 双击表格打开新一页 if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType....
var newwin = window.open(url,"newwin","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=600,height=450"); newwin.focus(); return false; } [removed] ...
3.9 JavaScript 基本数据结构. 3.10 JavaScript 运算符和表达式. 3.11 JavaScript 控制结构和循环. 第4 章 Window 对象 4.12 Window 对象的属性 4.13 Window 对象的方法 4.14 创建和关闭窗口 第5 章 document 对象. ...
void(keyit=window.open('http://www.365key.com/storeit.aspx?t='+escape(d.title)+'&u='+escape(d.location.href)+'&c='+escape(t),'keyit','scrollbars=no,width=475,height=575,left=75,top=20,status=no,...
e.item.Attributes.Add("ondblclick", "location.href='../ShippedGrid.aspx?id=" + orderItemID + "'"); } 双击表格打开新一页 if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ...
window.location.href="ads"; } /* 通过指定的方法来自定义栏数据 */ function customCheckBox(row, col){ return "<input type='checkbox'>"; } function customOrgName(row, col){ ...