Sorry, but I don't completely understand what you're doing there.

But this is what I'd try (example html)

<html>
<body>
<ol>
<script>
// define the test text
var mytext="this is 'MyText', an awful piece of $%&%$ยง is mytext, that's 
what it is.";
// show it as "1"
document.writeln("<li>", mytext, "</li>");
// change to lower case
var mylower= mytext.toLowerCase();
// show it as "2"
document.writeln("<li>", mylower, "</li>");
// get all "words"
var myarray= mylower.match(/(\w+)/g);
// show them as "3"
document.writeln("<li>",myarray,"</li>");
// count word occurence
var mylist= new Object;
for (i in myarray) {
    ++mylist[myarray[i]];
}
// show just the words as "4"
document.writeln("<li>",Object.keys(mylist),"</li>");
</script>
</ol>
</body>
</html>


-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywikidev?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to