Some JS examples

xiaoxiao2021-03-06  55

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 = "__ evenettarget"; o1.ID = "__EventTarget"; Theform.Appendchild (O1);} if ("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 () {// get the HTML code for the table of ID = TB. 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 R = / ^ (-? / d ) (/./ d )? $ /; if (Re.test (s)) Return true; Return False;}

Function ISNUMERICSTRINGBYREG1 (S) {var Path = / ^ (-? / d ) (/. / d )? $ /; if (! regmatch (s, path)) Window.alert ("Please enter floating point number" Return True }

转载请注明原文地址:https://www.9cbs.com/read-113428.html

New Post(0)