Error: Could not load module in dojo

I have this super simple code in index.html

<script src="../../dojo/dojo.js"></script>
<script>
    dojo.require("dojo.fx");
    dojo.ready(function(){
        dojo.byId("greeting").innerHTML += ", from " + dojo.version;
        dojo.fx.slideTo({
            top: 100,
            left: 200,
            node: dojo.byId("greeting")
        }).play();
    });
</script>

I get error Error: Could not load 'dojo.fx'; last tried './fx.js'

Note: I hadn't changed dojo's directory structure. I'm using dojo 1.6

-dojo
-dijit
-dojox
-labs
 -ex01
  -index.html

Answers


The problem was dojo simply won't run from my local filesystem.

Run your source code from a web server, not the file system, even if the web server is running on your development machine. The browser's handling of HTTP requests from the local file system are more restrictive than from a web server, even when it's running in the same machine. For consistent results, you should always run Dojo from within any HTTP web server (Apache, nginx, Tomcat, IIS, Jetty, etc.).


Need Your Help

Is it possible to animate UIEdgeInsets?

ios swift animation uitextfield uiviewanimationtransition

I've been trying to animate a change in UIEdgeInsets. I've already tried using UIView.animateWithDuration and the insets just jump to the final values. Does anyone know if this a property that can'...

How to post XML to server thru HTML form?

html xml forms

I have to post data from my HTML form to server in xml format, something like:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.