Login Register

dojo.require

Dojo Not Defined (Odd One here)

Ok this is a bit odd but I will try and explain.

I have a javascript function that is dynamically adding a script tag to include dojo.js.

I can see in Firebug the script is loading the js file perfectly. I then have a second function that does my dojo.require statements.

What I get is dojo is not defined. When clearly I can see that it is.

So I thought well I will get clever and just dynamically create a series script tags to insert each of the js files for each of the modules I want to use.

Then I get dijit.byId is not a function.

How do I resolve this.

Loading custom modules in IE7

I am trying to build a custom widget, which I have placed in my own namespace mojo; the widget's name is mojo.View.

When I test in FireFox 3, everything works beautifully--well, except for my own bugs, but I can handle those.

When I test in IE7, I get the error:

Could not load 'mojo.View'; last tried '/dojotest.nsf/mojo/View.js'

(FYI, dojotest.nsf is a Domino database, but it serves web pages like any other web server, and so should not e an issue.)

I have tried googling for this, and found JBurke's example described here

Loading modules (drives me mad)

Hi everyone!

I have a Dojo application, client-side-only (i.e. no server). I want the following directory structure:

app.html <- this is the application's html file
styles   <- directory with CSS
scripts  <- directory with .js
  |
  -dojo  <- directory with dojo.js
  |
  -dijit
    |
    -layout
    |
    -etc

How do I setup this structure? I tried using dojo.registerModulePath, but with no success...

Thank you in advance!

Is there a widget factory in dojo for loading widgets that aren't dojo.required(...)

Is there a widget factory built into Dojo?

Any know if I can do this eval("new " + selectedModule + "." + selectedWidget + '({title: "Click Me!"}, "widgetContainer")');

I'm trying to use dojo.data to load modules and widget stores dynamically. I can get to this point where I if I hardcoded selectedModule and selectedWidget the module namespace is set up and all files and dependencies have been ajaxed into dojo but I can't instantiate. Any ideas? Solutions? A better way to do this... kind of going for a dojo factory effect.

Hardcoded version works
new dojoCustom.form.Button({title: "Click Me!"}, "widgetContainer");

This version not so much...
eval("new " + selectedModule + "." + selectedWidget + '({title: "Click Me!"}, "widgetContainer")');

how to load dojo.dnd.*

   I use
   dojo.require("dojo.dnd.*");
   but the Console report Error:
   Could not load 'dojo.dnd.*'; last tried './dnd/*.js'
   why return these report,how to justify it.
   My dojo version:1.0.2 

Syndicate content