有的時候在首頁顯示的時候,列表裏面只需要字符串,不需要標籤,那麼就需要刪掉html標籤。
/**
* 刪掉所有的html標籤
* @param html
* @returns {XML|void|string}
*/
common.removeAllHtml = function (html) {
return html.replace(/<[^>]+>/g, '');
};
有的時候在首頁顯示的時候,列表裏面只需要字符串,不需要標籤,那麼就需要刪掉html標籤。
/**
* 刪掉所有的html標籤
* @param html
* @returns {XML|void|string}
*/
common.removeAllHtml = function (html) {
return html.replace(/<[^>]+>/g, '');
};