一些简单的js用法
2012-05-23 10:20
316 查看
------------------------------------------------------------------------全选--------------------
<script type="text/javascript">
$("document").ready(function () {
$("#all").click(function () {
if (this.checked) {
$("input[name='deleteids']").attr("checked",true);
} else {
$("input[name='deleteids']").each(function () { this.checked = false; });
}
});
})
----------------------------------------------------------------------后台注册脚本---------------------
ClientScript.RegisterClientScriptBlock(this.GetType(), "error", "alert('用户添加成功');window.location='UsersManager.aspx';", true);
--------------------------------------------------异步调用---
function getresult(id) {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
xmlhttp.onreadystatechange = dealresult;
xmlhttp.Open("Get", "ResultAjax.aspx?operatid=" + id + "&randid" + Math.random());
xmlhttp.Send();
}
function dealresult(){
}
----------------------------------后台写js-----
1.打开新网页
ClientScript.RegisterClientScriptBlock(this.GetType(), "error", "window.open('AuditBankAccount.aspx?id=" + e.CommandArgument.ToString() "','newwindow','height=670, width=525, toolbar=no, menubar=no, scrollbars=yes, resizable=no, location=no, status=no,top=50,left=500px')",
true);
2.关闭当前页面,刷新父窗体的代码信息js:
1>父窗体对应的js代码:
<script type="text/javascript">
function ref() {
document.getElementById('<%= btnSubmit.ClientID%>').click();
}
</script>
2>子窗体代码
head中内容: <base target="_self" />
ClientScript.RegisterClientScriptBlock(this.GetType(), "error", string.Format("alert('{0}');this.opener.ref();self.close();", AuditBankAccount_BankAccount_rejectSuccess), true);
而opener对象表示是操作者,或者父窗体
<script type="text/javascript">
$("document").ready(function () {
$("#all").click(function () {
if (this.checked) {
$("input[name='deleteids']").attr("checked",true);
} else {
$("input[name='deleteids']").each(function () { this.checked = false; });
}
});
})
----------------------------------------------------------------------后台注册脚本---------------------
ClientScript.RegisterClientScriptBlock(this.GetType(), "error", "alert('用户添加成功');window.location='UsersManager.aspx';", true);
--------------------------------------------------异步调用---
function getresult(id) {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
xmlhttp.onreadystatechange = dealresult;
xmlhttp.Open("Get", "ResultAjax.aspx?operatid=" + id + "&randid" + Math.random());
xmlhttp.Send();
}
function dealresult(){
}
----------------------------------后台写js-----
1.打开新网页
ClientScript.RegisterClientScriptBlock(this.GetType(), "error", "window.open('AuditBankAccount.aspx?id=" + e.CommandArgument.ToString() "','newwindow','height=670, width=525, toolbar=no, menubar=no, scrollbars=yes, resizable=no, location=no, status=no,top=50,left=500px')",
true);
2.关闭当前页面,刷新父窗体的代码信息js:
1>父窗体对应的js代码:
<script type="text/javascript">
function ref() {
document.getElementById('<%= btnSubmit.ClientID%>').click();
}
</script>
2>子窗体代码
head中内容: <base target="_self" />
ClientScript.RegisterClientScriptBlock(this.GetType(), "error", string.Format("alert('{0}');this.opener.ref();self.close();", AuditBankAccount_BankAccount_rejectSuccess), true);
而opener对象表示是操作者,或者父窗体
相关文章推荐
- js回调函数和作用域的一些简单用法
- 发邮件 上传图像 JS中的EVENT GRIDVIEW的简单应用 JS中一些寻找控件的用法
- 关于js中小问题与一些简单函数的用法
- JS的一些简单实例用法
- android_listView一些简单用法(动态)
- js 的一些属性和用法
- js一些用法及几个常用的ASP代码
- js操作表格的一些简单方法
- {js 一些小用法保存}
- git的一些简单用法
- js createRange与createTextRange的一些用法实例
- jquery.cycle.js简单用法实例
- 关于 常用的Banner一些简单用法 站在巨人的肩膀上
- Linq一些简单的用法
- js中Date()函数的用法简单小结
- 前端开发JS、CSS的一些用法积累()
- js中escape的用法----前端页面简单加密
- Java中Calendar的一些简单操作 及 JS中获取当前时间前一天时间(js中时间Date操作)
- 记录下, sql server下面语句的一些简单用法
- Android Animation的一些简单用法