javascript子页面刷新父页面
前台页面为 子页面为一个按钮:
<form id="form1" runat="server">
<div>
<asp:Button runat="server" ID="Bt_Add" Text="添加" Width="80px" Height="20px" OnClick="Bt_Add_Click" />
</div>
</form>
在后台onClick中添加:
protected void Bt_Add_Click(object sender, EventArgs e)
{
//你要做的事情然后刷新父页面
//刷新父页面
ClientScript.RegisterStartupScript(this.GetType(), "ReLoad", "ReLoad();", true);
}
在子页面加入javascript脚本
<script type="text/javascript" language="javascript">
function ReLoad() {
if(window.opener)
{//如果父页面还在的话
window.opener.location.reload();//先刷新父页面
window.opener = null;//
window.close();//这两句是为了不出现提示
}
}
</script>
点击时会摔新父页面。在关闭本页面!
相关文档:
"^\d+$" //非负整数(正整数 + 0)
"^[0-9]*[1-9][0-9]*$" //正整数
"^((-\d+)|(0+))$" //非正整数(负整数 + 0)
"^-[0-9]*[1-9][0-9]*$" //负整数
"^-?\d+$" //整数
"^\d+(\.\d+)?$" //非负浮点数(正浮点数 + 0)
"^(([0 ......
本文转自:http://bbs.51js.com/viewthread.php?tid=85083&extra=page%3D1
在自定义的函数中,如果要向函中提交一些参数,习惯性地大家会在函数中定义
例:<script>
function test(a,b){
alert(a);
alert(b);
}
test("第一次" ......
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>JS调用现成Word模板完成打印</title>
<script type="text/javascript">
//转换word的函数
function ......
设为首页和添加收藏的Javascript代码,兼容性还可以,各种主流浏览器都测试通过了。
function addfavorite(){//加入收藏
if (document.all){
window.external.addFavorite("http://"+document.location.host+"/",document.title);
}else if (window.sidebar){
window.sidebar.addPanel(document.tit ......
ADF 11g不再支持Onclick等JavaScript,而是采用<af:clientListener>来实现诸如删除某条记录的提示框。
实现方式如下:
function confirmDelete() {
if (confirm('Are you sure you want to delete this record?'))
return true;
else
return false;
}
<af:commandLink actionListener="# ......