Login Register

Could not load 'dojo.event.*'

It is my first to use dojo. When I am running my first example in book which programs using dojo 0.4,I met the error:

Could not load 'dojo.event.*'; last tried './event/*.js' index.htm (line 21)

the dojo version I use is 1.0.2,resoure is below,please help me find the reason of error,thanx:

<html>
<head>
<title> ScriptSrcIO Page </title>
<style type="text/css">
.bookmarks {
   width: 300;
   background: lightGray;
   border-style: solid;
   border-width: 2px;
   border-color: black
}
</style>
<script language="JavaScript" type="text/javascript">
        
        // Dojo configuration
  djConfig = {
   // preventBackButtonFix: true,
   //debugAtAllCosts: true,
   isDebug: true
  };
</script>
<!--all dojo files are in the dir of 'js'-->
<script language="JavaScript" type="text/javascript" src="js/dojo.js"> </script>
<script type="text/javascript">
    dojo.require("dojo.event.*");
    dojo.require("dojo.io.*");
    dojo.require("dojo.io.ScriptSrcIO");
    dojo.addOnLoad(getBookmarks);
function getBookmarks() {
     dojo.io.bind({
         url: "http://del.icio.us/feeds/json/dojomaster",
         transport: "ScriptSrcTransport",
         jsonParamName: "callback",
         load: function(type, data, event, kwArgs){showBookmarks(data);},
         mimetype: "text/json",
         timeout: function() {alert('timeout');},
         timeoutSeconds: 10
     });
}
function showBookmarks(posts) {
  var div = document.getElementById("container");
  for (var i=0, post; post = posts; i++) {
   div.innerHTML += " <a href='" + post.u + "' > " + post.d + " </a> <br/> ";
  }
  }
</script>
</head>
<body>
<div id="container" class="bookmarks"> </div>
</body>
</html>

Examples from the book you

Examples from the book you reference, that include dojo 0.4 examples, probably won't work in current dojo (0.9 and beyond, ~1.1 today). You could look at the migration help here:

http://dojotoolkit.org/book/dojo-porting-guide-0-4-x-0-9

and here:

http://dojotoolkit.org/book/dojo-porting-guide-0-9-x-1-0

or just use the examples in the current "Book of Dojo" here:

http://dojotoolkit.org/book/dojo-book-1-0

but

thanx upper.After I tried to get all sources from svn(http://svn.dojotoolkit.org/dojo/trunk),it's all right to run the example again.so I think whether there is something wrong with the zip file I download from dojotoolkit.org.Its full url is :http://download.dojotoolkit.org/release-1.0.2/dojo-release-1.0.2.zip,I mean maybe the zip is in lack of some js files so that the example could not normally run.