Javascript String toPermaLink()
toPermaLink()
String.prototype.toPermaLink = function() { var unsafeCharactersRegEx = /[^a-z0-9]*$/gi; var str = this.toString(); return str.replace(unsafeCharactersRegEx, '').toLowerCase().replaceAll(' ','-'); }