一些js例子
来源:岁月联盟
时间:2004-09-28
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; }
上一篇:popup的两种方法
下一篇:无刷新聊天室(短信陪聊程序)











