2015-12-23 23 views

回答

0

我下載了dojo.js,並把它放在hellodojo.html所在的地方。然後,我改變了hellodojo.html的代碼如下:

<!DOCTYPE html> 
<html> 
<head> 
    <meta charset="utf-8"> 
    <title>Tutorial: Hello Dojo!</title> 
</head> 
<body> 
    <h1 id="greeting">Hello</h1> 
    <!-- load Dojo --> 
    <script src="./dojo.js" data-dojo-config="async: true"></script> 
    <script> 
     require([ 
      'dojo/dom', 
      'dojo/dom-construct' 
      ], function(dom, domConstruct) { 
       var greetingNode = dom.byId('greeting'); 
       domConstruct.place('<em> Dojo!!~!!</em>', greetingNode); 
      }); 
    </script> 
</body> 
</html> 

在這裏你會看到我改變了說法

<script src="//ajax.googleapis.com/ajax/libs/dojo/1.10.4/dojo/dojo.js" 
     data-dojo-config="async: true"></script> 

<script src="./dojo.js" data-dojo-config="async: true"></script> 

,然後它的工作如預期,因爲dojo.js現在可用。 我也可以在源代碼的Chrome擴展中看到'dojo.js'。

相關問題