Template:TestTemplate: Difference between revisions
From FANTOM5_SSTAR
No edit summary |
No edit summary |
||
Line 3: | Line 3: | ||
var content = "</html>{{{1}}}<html>"; | var content = "</html>{{{1}}}<html>"; | ||
var | |||
alert( | |||
function getDistinctElements(content) { | |||
var result = []; | |||
$.each(anArray, function(i,v){ | |||
if ($.inArray(v, result) == -1) result.push(v); | |||
}); | |||
return result; | |||
} | |||
for(var i=0, l=result.length; i<l; i++){ | |||
var tmp =result[i]; | |||
var counted = countItems(content,tmp); | |||
alert(counted); | |||
} | |||
function countItems(arr, what){ | function countItems(arr, what){ |
Revision as of 17:34, 11 June 2013