[JavaScript] How to use HightLight in Dojo?

来源:互联网 发布:特斯拉知乎 编辑:程序博客网 时间:2024/06/05 05:41

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>



0 0