jQueryでPHPと同様にトリムができるのでメモです。

使い方はいたってシンプル

var comment = ' test ';
comment = $.trim(comment);

// test
console.log(comment);

 

よろしくどうぞ!!