1111
/*page Refresh*/functionReload () {//window.parent.location.reload (); varParentwin =window.parent; Switch(type) { Case' Top ': Window.parent.location.reload (); Break; Case' Parent ': ParentWin.location.reload (); Break; default: Window.location.reload (); Break; }}
222
/*URL Custom URL encryption decrypts the encodeURI () function to encode a string as a URI decodeURI () function decodes a URI encoded by the encodeURI () function. *///get parent Directory URLfunctionGetupperurl () {varURL =window.location.href; varindex = Url.lastindexof ("\"); URL= url.substring (0,index + 1); returnURL;}//Encrypt, Decryptfunctionencode (URI) {returnencodeURI (URI);}functiondecode (URI) {returndecodeURI (URI);}
333
/** Create Matte * @param dom inserts a mask into the DOM*/functionCreateshade (DOM) {vardiv = $ (' <div> ')); Div.addclass (' Shade '); Div.attr ({//ID: ' Layui-layer-shade3 ', //Times : ' 3 ',Style: ' z-index:19891016; Background-color: #000; opacity:0.2; Filter:alpha (opacity=30); left:0;top:0;width:100%;height:100%;p Osition:absolute; ', }); if(dom = =undefined) {Dom= ' #tablelist '; } if(!$ ('. Shade '). Get (0) {$ (DOM). Append (div); }}//Unmute MaskfunctionRemoveshade () {$ ('. Shade '). Remove ();
View Code
444
//Get current Timefunctiongetnowformatdate () {varDate =NewDate (); varSeperator1 = "-"; varSeperator2 = ":"; varmonth = Date.getmonth () + 1; varStrdate =date.getdate (); if(Month >= 1 && month <= 9) {Month= "0" +month; } if(strdate >= 0 && strdate <= 9) {strdate= "0" +strdate; } varcurrentdate = date.getfullyear () + seperator1 + month + Seperator1 +strdate+ "" + date.gethours () + Seperator2 +date.getminutes ()+ Seperator2 +date.getseconds (); returncurrentdate;}//Amount Format Conversionfunctionformatnum (str) {varNewstr = ""; varCount = 0; STR=String (parsefloat (str)); if(Str.indexof (".") ==-1){ for(vari=str.length-1;i>=0;i--){ if(count% 3 = = 0 && count! = 0) {Newstr= Str.charat (i) + "," +Newstr; }Else{newstr= Str.charat (i) +Newstr; } Count++; } STR= Newstr + ". 00";//Auto-complement two digits after decimal point returnstr; }Else{ for(vari = Str.indexof (".") -1;i>=0;i--){ if(count% 3 = = 0 && count! = 0) {Newstr= Str.charat (i) + "," +Newstr; }Else{newstr= Str.charat (i) + newstr;//by Word typeface.} Count++; } STR= Newstr + (str + "XX"). substr ((str + "XX"). IndexOf ("."), 3); returnstr; }};
View Code
Don't say anything, come on 4-wave JS