统计jQuery中各字符串出现次数的工具

2020-05-23 06:02:24易采站长站整理

relative: [/’relative’/g, /”relative”/g],
‘static’: [/’static’/g, /”static”/g],
fixed: [/’fixed’/g, /”fixed”/g],
href: [/’href’/g, /”href”/g],
border: [/’border’/g, /”border”/g],
margin: [/’margin’/g, /”margin”/g],
marginTop: [/’marginTop’/g, /”marginTop”/g],
marginBottom: [/’marginBottom’/g, /”marginBottom”/g],
marginLeft: [/’marginLeft’/g, /”marginLeft”/g],
marginRight: [/’marginRight’/g, /”marginRight”/g],
padding: [/’padding’/g, /”padding”/g],
paddingTop: [/’paddingTop’/g, /”paddingTop”/g],
paddingLeft: [/’paddingLeft’/g, /”paddingLeft”/g],
paddingRight: [/’paddingRight’/g, /”paddingRight”/g],
display: [/’display’/g, /”display”/g],
olddisplay: [/’olddisplay’/g, /”olddisplay”/g],
none: [/’none’/g, /”none”/g],
hidden: [/’hidden’/g, /”hidden”/g],
inline: [/’inline’/g, /”inline”/g],
opacity: [/’opacity’/g, /”opacity”/g],
show: [/’show’/g, /”show”/g],
hide: [/’hide’/g, /”hide”/g],
toggle: [/’toggle’/g, /”toggle”/g],
json: [/’json’/g, /”json”/g],
success: [/’success’/g, /”success”/g],
fxshow: [/’fxshow’/g, /”fxshow”/g],
fx: [/’fx’/g, /”fx”/g],
‘.run’: [/’.run’/g, /”.run”/g],
‘http:’: [/’http:’/g, /”http:”/g],
error: [/’error’/g, /”error”/g],
abort: [/’abort’/g, /”abort”/g],
GET: [/’GET’/g, /”GET”/g],
POST: [/’POST’/g, /”POST”/g],
get: [/’get’/g, /”get”/g],
filter: [/’filter’/g, /”filter”/g],
px: [/’px’/g, /”px”/g]
};
function callback1(result) {
var obj = result[0];
var myshowEL = $(‘#myshow1’);
myshowEL = myshowEL.empty();
myshowEL.append(‘<div>’ + obj.type + ‘: <span style=”color: blue;”>’ + obj.num + ‘</span></div>’);
}
function callback2(result) {
var myshowEL = $(‘#myshow2’);
myshowEL = myshowEL.empty();
for (var i=0; i<result.length; i++) {
var obj = result[i];
myshowEL.append(‘<div>”‘ + obj.type + ‘”: <span style=”color: blue;”>’ + obj.num + ‘</span></div>’);