This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="text"></div> | |
<div id="cloud"></div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
font-family: "Lucida Sans", "Lucida Grande", "Lucida Sans Unicode", sans-serif; | |
} | |
#text { | |
display: none; | |
} | |
.tag { | |
display: inline-block; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function() { | |
var text = $('#text').text(); | |
var word_array = text.split(' '); | |
// blank array to store result | |
var word_count = {}; | |
// lets count the words | |
for ( var x in word_array ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="text"> | |
Itself two one. All. Us wherein replenish seas fly i open creeping dominion | |
deep over created so so. Isn't made lights is day won't he air first also | |
darkness fruit called bring. Forth one moving moved void to divided saw. | |
Shall air us own they're. Place fill meat heaven stars lights tree. Have | |
all, gathered saying third. Hath hath upon you of moved doesn't that own is | |
called own heaven he one whales, every dominion you'll. For creature appear, | |
male seas. Deep. Were Over. Created she'd a creature Signs whales is god. | |
Place given you'll brought his hath very may be Land creeping. Saw good our | |
face moving fly wherein air, a don't without fish void behold creeping every |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var text = $('#text').text(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var text = $('#text').text(); | |
var word_array = text.split(' '); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var text = $('#text').text(); | |
var word_array = text.split(' '); | |
// blank array to store result | |
var word_count = {}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var text = $('#text').text(); | |
var word_array = text.split(' '); | |
// blank array to store result | |
var word_count = {}; | |
// lets count the words | |
for ( var x in word_array ) { | |
// make the word lowercase | |
var word = word_array[x].toLowerCase(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for ( var y in word_count ) { | |
$('#cloud').append('<div class="tag" style="font-size: '+ word_count[y] +'px;">' + y + '</div>'); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="tag" style="font-size: {value}px;">{word}</div> |
OlderNewer