2010-04-09 115 views
2

我無法讓我的道場工作。我已經嘗試了一切。道場不爲我工作

下面是代碼:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
<html> 
<head> 

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/dojo/1.4/dojo/dojo.xd.js"> 


    dojo.addOnLoad(function(){ 
    console.log("page ready, can modify DOM anytime after this"); 

}); 
</script> 

</head> 
<body> 

</body> 
</html> 
+0

錯誤信息?試試Firebug?你只是沒有看到控制檯輸出? – 2010-04-09 14:09:02

+0

是的,沒有看到任何控制檯輸出。沒有錯誤消息。 – pfdevilliers 2010-04-09 14:13:38

回答

6

把你的代碼,並把它放在另一個腳本標籤道場腳本標籤後:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/dojo/1.4/dojo/dojo.xd.js"></script> 
<script type="text/javascript"> 
dojo.addOnLoad(function(){ 
    console.log("page ready, can modify DOM anytime after this"); 
}); 
</script> 

src屬性也不能包含代碼的腳本標籤,除非你使用John Resig-like hack

+0

謝謝,但是console.log的輸出結果在哪裏? – pfdevilliers 2010-04-09 14:45:43

+0

在你的例子中,它實際上並沒有被調用......瀏覽器完全忽略它。 – 2010-04-09 14:49:17

+0

是的,我知道。但是使用螢火蟲,我使用console.debug來輸出到控制檯。 console.log在哪裏去? – pfdevilliers 2010-04-10 07:45:00

相關問題