Ethnaの組み込みSmartyプラグインの "{...|truncate_i18n}"の様な処理をJavaScript側でできないかな。と、思っていたらprototype.jsのStringクラスの拡張でメソッドが用意されていた。
truncate([length = 30[, suffix = '...']]) -> string
Truncates a string to the given length and appends a suffix to it (indicating that it is only an excerpt).
なので、万事解決。
リファレンスよく読まないとだめ...。
(Visited 1 times, 1 visits today)