Go to the section behind the string # http://localhost:8090/admin/activity.html#list = ListString.prototype.hash = function () {var index = This.lastindexof ("#"); Return Index < 0? "": this.substring (index);};/ /String width Chinese characters are counted as 1 alphanumeric String.prototype.width = function () {var c = 0, Inc; for (var i = 0, n = this.length; i < n; i++) {inc = This.charcodeat (i) < 256? 0.5:1; C + = Inc; } return C;} String.prototype.mb_substr = function (w) {var c = 0, Inc, I; for (i = 0, n = this.length; i < n && c <= w; i++) {inc = This.charcodeat (i) < 256? 0.5:1; C + = Inc; } return this.substring (0, i);} Returns the maximum value of an array of integers Array.prototype.max = function () {var max = this[0]; for (var i = 1, n = this.length; i < n; i++) {if (This[i] > max) {max = this[i]; }} return max;};/ /Remove tags in HTML <div><p>...function strip_tags (HTML) {var div = document.createelement ("div"); Div.innerhtml= html; Return (div.textcontent | | div.innertext | | "");} Current month 201806function get_yyyymm () {var date = new Date (); var month = Date.getmonth () +1; Return (Date.getyear () + 1900) + "" + (month<10? ") 0 "+month:month);} Introduce CSS (JQUERY-UI.CSS) to head >link:first-child//load CSS before all <link> tagsfunction css (href) {var li NK = document.createelement ("link"); Link.type = "Text/css"; Link.rel = "stylesheet"; link.href = href; var dom = document.head.querySelector ("link"); Document.head.insertBefore (link, DOM);}
JavaScript strings are commonly used in custom functions, loading CSS etc.