Search code examples
javascripthtmldojo

dojo tutorial: dojo is not defined


I want to get startet with dojo.

Therefore I am useing their tutorials: http://dojotoolkit.org/documentation/tutorials/1.8/hello_dojo/

The simplest tutorial displays this page

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Tutorial: Hello Dojo!</title>
</head>
<body>
    <h1 id="greeting">Hello</h1>
    <!-- load Dojo -->
    <script src="//ajax.googleapis.com/ajax/libs/dojo/1.8.1/dojo/dojo.js"
               data-dojo-config="async: true"></script>
</body>
</html>

I now open the page (tried both localy and hosted version on their page). And when I write

dojo.query("h1")

in my firebug console I get the message:

ReferenceError: dojo is not defined

Please help


Solution

  • are your sure your source for dojo is in "//ajax.googleapis.com/ajax/libs/dojo/1.8.1/dojo/dojo.js" because your folder structure look like in googleapis folder which is "http://ajax.googleapis.com/ajax/libs/dojo/1.8.1/dojo/dojo.js"