This file contains 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 is2through9 = /[2-9]/; | |
var genElement = function(elm){ | |
var elementCount = 1; | |
var lastChar = elm[elm.length-1]; | |
if (is2through9.test(lastChar)){ | |
elementCount = lastChar; /* add coefficient */ | |
elm = elm.slice(0, -1); | |
} | |
return [elementCount, elm]; |
This file contains 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
<!doctype html> | |
<head> | |
<title>Word Count</title> | |
<link href="http://maxcdn.bootstrap | |
cdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet"> | |
<style> | |
.container { | |
padding-top: 40px; | |
} | |
.container *{ |
This file contains 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
JSON.encodeURI = function(jsonObject){ | |
var string; | |
$.each(jsonObject, function(key, value){ | |
string += "&" + encodeURIComponent(key) + "=" + encodeURIComponent(value); | |
}); | |
return string.slice(1); | |
} |
NewerOlder