⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 core1.js

📁 STL sort()函数使用详细介绍 包含STL算法介绍文档
💻 JS
📖 第 1 页 / 共 5 页
字号:
}return year+"-"+month+"-"+day;}function getShortDate(str){var d=new Date(str);var monthInt=d.getMonth()+1;var month=monthInt.toString();if(month.length<2){month="0"+month;}var day=d.getDate().toString();if(day.length<2){day="0"+day;}return month+"月"+day+"日";}function getShortTime(str){var d=new Date(str);var hour=d.getHours().toString();if(hour.length<2){hour="0"+hour;}var minute=d.getMinutes().toString();if(minute.length<2){minute="0"+minute;}return hour+":"+minute;}function getDateForMysql(str){var d=new Date(str);var year=d.getFullYear().toString();var monthInt=d.getMonth()+1;var month=monthInt.toString();if(month.length<2){month="0"+month;}var day=d.getDate().toString();if(day.length<2){day="0"+day;}var hour=d.getHours().toString();if(hour.length<2){hour="0"+hour;}var minute=d.getMinutes().toString();if(minute.length<2){minute="0"+minute;}var second=d.getSeconds().toString();if(second.length<2){second="0"+second;}return year+"-"+month+"-"+day+" "+hour+":"+minute+":"+second;}function Trim(TRIM_VALUE){if(TRIM_VALUE.length<1){return"";}TRIM_VALUE=RTrim(TRIM_VALUE);TRIM_VALUE=LTrim(TRIM_VALUE);if(TRIM_VALUE==""){return"";}else{return TRIM_VALUE;}}function RTrim(VALUE,w_spaces){if(w_spaces==undefined||w_spaces==null){w_spaces=[];w_spaces.push(String.fromCharCode(32));}var v_length=VALUE.length;var strTemp="";if(v_length<0){return"";}var iTemp=v_length-1;while(iTemp>-1){var ch=VALUE.charAt(iTemp);var match=false;for(var i=0;i<w_spaces.length;i++){if(ch==w_spaces[i]){match=true;break;}}if(!match){strTemp=VALUE.substring(0,iTemp+1);break;}iTemp=iTemp-1;}return strTemp;}function LTrim(VALUE,w_spaces){if(w_spaces==undefined||w_spaces==null){w_spaces=[];w_spaces.push(String.fromCharCode(32));}if(v_length<1){return"";}var v_length=VALUE.length;var strTemp="";var iTemp=0;while(iTemp<v_length){var ch=VALUE.charAt(iTemp);var match=false;for(var i=0;i<w_spaces.length;i++){if(ch==w_spaces[i]){match=true;break;}}if(!match){strTemp=VALUE.substring(iTemp,v_length);break;}iTemp=iTemp+1;}return strTemp;}function TrimSBCandDBC(TRIM_VALUE){if(TRIM_VALUE.length<1){return"";}TRIM_VALUE=RTrim(TRIM_VALUE,[String.fromCharCode(32),' ']);TRIM_VALUE=LTrim(TRIM_VALUE,[String.fromCharCode(32),' ']);if(TRIM_VALUE==""){return"";}else{return TRIM_VALUE;}}function isEmptyDiv(str){var trim=Trim(str);if(trim=="")return true;var rep=/^<DIV>(&nbsp;<\/DIV><DIV>)*(&nbsp;)*<\/DIV>$/i;if(rep.test(trim)){return true;}elsereturn false;}function isEmptyContent(str){var trim=Trim(str);if(trim=="")return true;trim=trim.replace(/<\/?(div|p|span|br).*?>/ig,"");trim=trim.replace(/(&nbsp;|\s)*/ig,"");if(trim=="")return true;elsereturn false;}function _ge(id){return document.getElementById(id);}function removeAllChild(el){var firstChild=el.firstChild;var curChild=firstChild;while(curChild!=null){el.removeChild(curChild);if(isIE)curChild.outerHTML='';curChild=curChild.nextSibling;}}function insertAfter(parent,node,referenceNode){parent.insertBefore(node,referenceNode.nextSibling);}function containsIllegalChar(content){var regi=/^(.*)['"‘“\/\\<>](.*)$/;if(regi.test(content))return true;elsereturn false;}function testUrl(str){var illegalChar=/^(.*)['"‘“<>](.*)$/;if(illegalChar.test(str))return false;elsereturn true;}function checkUserName(str){var illegalChar=/^(.*)[<>](.*)$/;if(illegalChar.test(str))return false;elsereturn true;}function checkMail(str){var mail=/^(.+)@(.+)\.(.+)$/;if(!mail.test(str))return false;if(str.indexOf('@')!=str.lastIndexOf('@'))return false;var illegalChar=/^(.*)['"‘“\/\\<>](.*)$/;if(illegalChar.test(str))return false;elsereturn true;}function checkDateFormat(str){var format=/^\d{4}\-\d{2}\-\d{2}$/;if(format.test(str))return true;elsereturn false;}function checkBirthday(str){var today=new Date();var barray=str.split(new RegExp("-","g"));var birthday=new Date(barray[0],barray[1]-1,barray[2]);if(parseInt(barray[0])<1900){return-1;}if(birthday.getTime()>today.getTime()){return 1;}else if(birthday.getFullYear()<1900){return-1;}else{return 0;}}function extractHtmlText(content){content=content.replace(/&nbsp;/ig," ").replace(/&lt;/ig,"<").replace(/&gt;/ig,">").replace(/&#039;/ig,"'").replace(/&quot;/ig,"\"").replace(/&amp;/ig,"&");return content;}function convertStr(str){if(str==null)return'&nbsp;';str=Trim(str);if(str=='')str='&nbsp;';return str;}function replaceLineBreak(str){return str.replace("\n","<br>");}function textareaLimit(field,maxlen){if(field.value.length>maxlen){field.value=field.value.substring(0,maxlen);alert("超过最大字数限制"+maxlen+"个! ");}}function textLimit(text,maxlen){if(text.length>maxlen){text=text.substring(0,maxlen);alert("超过最大字数限制"+maxlen+"个! ");}}String.prototype.nlToBr=function(){return this.trim().nl2br();}String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"");};String.prototype.nl2br=function(){return this.split("\n").join("<br />\n");};String.prototype.trimSQ=function(){return this.replace("&#39;","\\\'");};String.prototype.escape=function(){return this.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&#34;").replace(/'/g,"&#39;");};String.prototype.js_escape=function(){return this.replace(/\\/g,"\\\\").replace(/'/g,"\\&#39;").replace(/"/g,"\\&#34;");};String.prototype.escape_freemark=function(){return this.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;");};String.prototype.unescape_freemark=function(){return this.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,"\"");};function searchList(el,list){var i=0;for(i=0;i<list.length;i++){if(el==list[i]){return true;}}return false;}function removeSameEl(list){var newList=new Array();var i;var el;for(i=0;i<list.length;i++){el=list[i];if(el!=null){var data;if(!searchList(el,newList)){newList.push(el);}}}return newList;}function insertShiftAt(list,el,position){if(position<0){position=0;}else if(position>list.length){positon=list.length;}var prevListvar nextList;for(i=list.length;i>position;i--){list[i]=list[i-1];}list[position]=el;}var _get_event_src=function(e){if(e){return e.target;}if(window.event){return window.event.srcElement;}return null;};function appendCss(elem,newCss){$(elem).className+=" "+newCss;}function removeLastCss(elem,oldCss){$(elem).className=$(elem).className.replace(new RegExp(" "+oldCss+"\\b"),"");}function attachFocusEvent(focusArray,focusCss){focusArray.each(function(E){if($(E)){$(E).onfocus=function(){this.className+=" "+focusCss;}$(E).onblur=function(){this.className=this.className.replace(new RegExp(" *"+focusCss+"\\b"),"");}}});}function attachOverEvent(focusArray,focusCss){focusArray.each(function(E){if($(E)){$(E).onmouseover=function(){this.className+=" "+focusCss;}$(E).onmouseout=function(){this.className=this.className.replace(new RegExp(" *"+focusCss+"\\b"),"");}}});}function applySelectCss(id){var _htc_select_reg=/\bselitm\b/g;if(window.$$_last_select!=null){window.$$_last_select.className=window.$$_last_select.className.replace(_htc_select_reg,"");}if($(id)){$(id).className+=" selitm";window.$$_last_select=$(id);}else{window.$$_last_select=null;}}function attachFocusEvent2(focusArray,focusCss,focusFunc,blurFunc){focusArray.each(function(E){if($(E)){$(E).onfocus=function(){this.className+=" "+focusCss;if(focusFunc!=null){focusFunc($(E));}}$(E).onblur=function(){this.className=this.className.replace(new RegExp(" "+focusCss+"\\b"),"");if(blurFunc!=null){blurFunc($(E));}}}});}function focusEvent(obj,focusCss){obj.className+=" "+focusCss;}function blurEvent(obj,focusCss){obj.className=obj.className.replace(new RegExp(" "+focusCss+"\\b"),"");}function disable(elem){$(elem).disabled=true;}function enable(elem){$(elem).disabled=false;}function getFloat(value,len){var str=value.toString();var index=str.indexOf(".");if(index==-1)return parseFloat(str);if(len==0)return parseFloat(str.substr(0,index));elsereturn parseFloat(str.substr(0,index+len+1));}function copyText(elemId){ie=(document.all)?true:falseif(ie){var rng=document.body.createTextRange();rng.moveToElementText($(elemId));rng.scrollIntoView();rng.select();rng.execCommand("Copy");rng.collapse(false);return true;}else{alert("你的浏览器安全设置不允许自动执行复制操作,请选中文本使用键盘(Ctrl+C)复制!");return false;}}function detectFlash(){var reqMajorVer=7;var reqMinorVer=0;var reqRevision=0;reqVer=parseFloat(reqMajorVer+"."+reqRevision);if(isIE&&isWin&&!isOpera){versionStr=VBGetSwfVer();}else{versionStr=JSGetSwfVer();}if(versionStr==-1){return false;}else if(versionStr!=0){if(isIE&&isWin&&!isOpera){tempArray=versionStr.split(" ");tempString=tempArray[1];versionArray=tempString.split(",");}else{versionArray=versionStr.split(".");}ve

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -