编程语言

img 2002pine

一些js例子

发表于2004/9/24 17:04:00  678人阅读

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; }
阅读全文
0 0

相关文章推荐

img
取 消
img