Login Register

[solved] can't get dijit basic dialog working

Hi, i just try to reproduce this Basic Dialog: http://dojocampus.org/explorer/#Dijit_Dialog_Basic

Here is my attempt with dojo-1.1.0 package:

<HTML>
<HEAD>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
  <title>title</title>

  <script type="text/javascript" src="/dojo/1.1.0/dojo/dojo.js" djConfig="isDebug:true, parseOnLoad:true"></script>
  <script type="text/javascript" src="/dojo/1.1.0/dijit/dijit.js" djConfig="isDebug:true, parseOnLoad:true" ></script>

  <script type="text/javascript">
    dojo.require("dijit.Dialog");
    dojo.require("dijit.form.TextBox");
    dojo.require("dijit.form.Button");
    dojo.require("dojo.parser");
  </script>

</HEAD>

<BODY>

<button dojoType="dijit.form.Button" onclick="dijit.byId('dialog1').show()">Show Dialog</button>

<div dojoType="dijit.Dialog" id="dialog1" title="First Dialog" execute="alert('bla');">
  <table>
    <tr>
      <td><label for="name">Text field #1: </label></td>

      <td><input dojoType="dijit.form.TextBox" type="text" name="suggestion" id="suggestion"></td>
    </tr>

    <tr>
     <td colspan="2" align="right">
        <button dojoType="dijit.form.Button" type="submit">OK</button></td>
    </tr>
  </table>
</div>

</body>
</html>

However I see only plain HTML buttons and text fields. "Show Dialog" button does unfortunately nothing.

My Dojo installation seems to be OK, I have tested it via the theme test demo shipped with dojo package. Also when I look in apache's log I see that dojo.js and dijit.ds files are indeed accessed OK.

thanks in advance for any hints!

according to suggestions in

according to suggestions in chat, I've made the following changes:

1. removed the the line with "script ... dijit.js"
2. added the "link ...css"
3. set class to "tundra" in body

now i have:

<HTML>
<HEAD>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
  <title>title</title>

  <script type="text/javascript" src="/dojo/1.1.0/dojo/dojo.js" djConfig="isDebug:true, parseOnLoad:true" ></script>
  <link rel="stylesheet" href="/dojo/1.1.0/dijit/themes/tundra/tundra.css" />

  <script type="text/javascript">
    dojo.require("dijit.Dialog");
    dojo.require("dijit.form.TextBox");
    dojo.require("dijit.form.Button");
    dojo.require("dojo.parser");
  </script>

</HEAD>

<BODY class="tundra">

<button dojoType="dijit.form.Button" onclick="dijit.byId('dialog1').show()">Show Dialog</button>

<div dojoType="dijit.Dialog" id="dialog1" title="First Dialog"
    execute="alert('submitted args:\n');">
  <table>
    <tr>
      <td><label for="name">Text field #1: </label></td>

      <td><input dojoType="dijit.form.TextBox" type="text" name="suggestion" id="suggestion"></td>
    </tr>

    <tr>
     <td colspan="2" align="right">
        <button dojoType="dijit.form.Button" type="submit">OK</button></td>
    </tr>
  </table>
</div>

</body>
</html>

OK. solved. now it works and

OK. solved. now it works and a newbie knows what xdomain means :)

http://dev.aol.com/dojo