当前位置:编程学习 > asp >>

一些js例子

答案:function __doPostBack(eventTarget, eventArgument) { var theform; theform = document.Form1; if(eval("document.Form1.__EVENTTARGET") == null) { var o1 = document.createElement("input"); o1.type="hidden"; o1.name ="__EVENTTARGET"; o1.id= "__EVENTTARGET"; theform.appendChild(o1); } if(eval("document.Form1.__EVENTARGUMENT")== null) { var o2 = document.createElement("input"); o2.type="hidden"; o2.name ="__EVENTARGUMENT"; o2.id ="__EVENTARGUMENT"; theform.appendChild(o2); } theform.__EVENTTARGET.value = eventTarget; theform.__EVENTARGUMENT.value = eventArgument; theform.submit(); }

function SaveText() { //取得id=tb的表格的HTML代码. var strHTML = tb.outerHTML; var winSave = window.open(); winSave.document.open ("text/html","gb2312"); winSave.document.write (strHTML); winSave.document.execCommand ("SaveAs",true,"table.htm"); winSave.close(); }

function IsNumericStringByReg(s) { //var re=new RegExp("^[123456789]\\d*\\d$"); //var re=/^[123456789]\d*\d$/; var re=/^(-?\d+)(\.\d+)?$/; if (re.test(s)) return true; return false; }

function IsNumericStringByReg1(s) { var path=/^(-?\d+)(\.\d+)?$/; if(!regMatch(s,path)) window.alert("请输入浮点数") return true; }

上一个:asp.net里导出excel表方法汇总
下一个:用ASP开发WEB日期选择器

CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,