拼接html代码相对美观的方法

var regexpComment = /\/\*([\s\S]*?)\*\//; 
var multiline = function(func){    
   return regexpComment.exec(func.toString())[1];    
}
var s = multiline(function(){
/*<div>
<table>
	<tr>
		<td>
			123456
		</td>
	</tr>
</table>
</div>*/
});
console.log(s);


同事大哥告诉我的,长见识了。。。

猜你喜欢

转载自blog.csdn.net/u011025329/article/details/71515004
今日推荐