[JavaScript] How to use HightLight in Dojo?

The HightLight can help make the code blocks in the HTML more beautifully. This recipe tells you how to use this cool feature in the Dojo toolkit.

<!DOCTYPE HTML>
<html>
	<head>
		<title>Dojo Trip</title>
		<link rel="stylesheet" href="http://yandex.st/dojo/1.9.1/dojox/highlight/resources/highlight.css" />
	</head>
	<body>
		<div id="main">
			<div id="code" class="javascript">
				var name = "Dojo";			
			</div>
		
		</div>
		
		<script type="text/javascript">
			var dojoConfig = {async: false};
		</script>
		<script src="http://yandex.st/dojo/1.9.1/dojo/dojo.js"></script>
		<script type="text/javascript">
			require(["dojox/highlight/_base",‘dojo/ready‘,"dojox/highlight/widget/Code","dojox/highlight/languages/javascript"],function(highlight,ready,Code){
				ready(function(){
					new highlight.Code({},"code");
					//var code = new Code({},‘code‘);
					//code.startup();				
				});			
			});			
		</script>
	</body>
</html>



[JavaScript] How to use HightLight in Dojo?,布布扣,bubuko.com

[JavaScript] How to use HightLight in Dojo?

上一篇:企业微信“三次握手”


下一篇:C语言字节对齐