javascript常用技巧汇总

javascript常用技巧汇总

ID:35318589

大小:50.00 KB

页数:12页

时间:2019-03-23

javascript常用技巧汇总_第1页
javascript常用技巧汇总_第2页
javascript常用技巧汇总_第3页
javascript常用技巧汇总_第4页
javascript常用技巧汇总_第5页
资源描述:

《javascript常用技巧汇总》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库

1、JavaScript常用技巧汇总(一).确认删除用法: 1.BtnDel.Attributes.Add("onclick","returnconfirm('"+"确认删除?"+"')"); 2.linktempDelete.Attributes["onclick"]="javascript:return confirm('"+"确认删除?"+"');"; 3.privatevoidgrdProject_ItemDataBound(objectsender,DataGridItemEventArgse) 4. {if((e.Item.ItemT

2、ype==ListItemType.Item)

3、(e.Item.ItemType==ListItemType.AlternatingItem)){ //刪除按鈕上的提示部分 e.Item.Cells[10].Attributes.Add("onclick","returnconfirm('确定删除吗?');");}  } 5.  functiondelete_y(e)    {  if(event.srcElement.outerText==

4、"删除")    event.returnValue=confirm("确定删除?");}document.onclick=delete_y;  (二).跨语言字符串替换  System.Text.RegularExpressions.Regex.Replace(str1,@"<{1}[^<>]*>{1}","").Replace(" ","").Replace("\","\").Replace("-","-").Replace("&","&").Replace("<","<")

5、.Replace(">",">").Replace("br","");(三).关闭窗体 1.   this.btnClose.Attributes.Add("onclick", "window.close();returnfalse;"); 2.关闭本窗体间跳转到另一个页面   this.HyperLink1.NavigateUrl="javascript:onclick=window.opener.location.assign    ('"+"index.aspx"+"?&Func=Edit&AutoID="+intAutoid

6、+');window.close();"; 3.关闭父窗体:   'onclick="window.parent.close()" Class="Button"> 4.关闭本弹出窗体,并刷新父页面   this.Response.Write("window.opener.location.reload();window.close();");(四).WebMessageBox  1. 

7、  Response.Write("window.alert('保存成功1');"); 2.   Response.Write(""); 3.   this.Page.RegisterStartupScript("ChiName","alert('"+"保存成功!"+"')");(五).DataGrid中加CheckBox

8、控件模板列. 请看: http://blog.csdn.net/chengking/archive/2005/10/08/497520.aspx(六).window.open()方法语法:window.open(pageurl,name,parameters);window对象的open()方法用于创建一个新的窗口实例,新创建的窗口的外观由参数:parameters指定。新窗口中打开的文档由参数:    pageurl指定。系统能够根据参数:name确定的名称访问该窗口。    下表为parameters参数表:    参数     衩始值 

9、    说明    alwaysLoweredyes/no指定窗口隐藏在所有窗口之下。    alwaysRaisedyes/no指定窗口浮在所有窗口之上。    

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。