js文件對比工具mergely

若是能力不錯能夠直接去閱讀官方文檔資料,再厲害的請去gitjavascript

首先去下載須要的資料。css

<!DOCTYPE html>
<html lang="zh">
<head>
<script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
<script type="text/javascript" src="../lib/codemirror.min.js"></script>
<link type="text/css" rel="stylesheet" href="../lib/codemirror.css" />
<script type="text/javascript" src="../lib/mergely.js"></script>
<link type="text/css" rel="stylesheet" href="../lib/mergely.css" />
<script type="text/javascript">
	$(document).ready(function() {
		$('#compare').mergely({
			cmsettings : {
				readOnly : false,
				lineNumbers : true
			},
			lhs : function(setValue) {
				setValue('the quick red fox\njumped over the hairy dog');
			},
			rhs : function(setValue) {
				setValue('the quick brown fox\njumped over the lazy dog');
			}
		});
	});
</script>
</head>
<body>
	<div id="compare"></div>
</body>
</html>

具體使用介紹請查看官方文檔,聰明的你必定會的html

相關文章
相關標籤/搜索