String.prototype.getQuery = function(name){var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");var r = this.substr(this.indexOf("\?")+1).match(reg);if (r!=null) return unescape(r[2]); return null;}var s = "i…
方法一: var str="sdfseresssssdssdfsa"; var arr=[]; var max=0; var maxk; for(var i=0;i<str.length;i++){ var k=str[i]; if(!arr[k]){ arr[k]=str.split(k).length-1; } } for(var n in arr){ if(max < arr[n]){ max=arr[n]; maxk=n; } } console.log("…