Dojo doesn't work for me

I cannot get dojo to work. I've tried everything.

Here is the code:

<!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>

      

+2


source to share


1 answer


Take your code and put it in another script tag after the dojo script tag:

<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>

      



Attributed script tag src

also cannot contain code unless you use John Resig-like hack .

+6


source







All Articles