0

(Updated at the end)

My problem is similar to the one asked in one of the previous questions I have just started learning Dojo and one of my sample scripts is not working in Firefox, though it works fine in Chrome. I am attaching the script. (Apologies for poor formatting). Will appreciate any suggestions. Note It is NOT a problem wih NoScript as I dont have it installed.

<html xmlns="http://www.w3.org/1999/xhtml">

<title>Tutorial: Hello Dojo!</title>

<script src=".\dojo-release-1.6.1\dojo\dojo.js"></script>

<script>

    function init() {
        alert("Dojo ready, version:" + dojo.version); // More initialization
        here
    }

    function slide() {
        // The piece we had before - change our innerHTML
        dojo.byId("greeting").innerHTML += ", from " + dojo.version;

        // Now, slide the greeting
        dojo.fx.slideTo({
            top: 200,
            left: 300,
            node: dojo.byId("greeting")
        }).play();
    }

    // New: Require in the dojo.fx module
    dojo.require("dojo.fx");

    // Remember, dojo.ready waits for both the DOM and all dependencies
    dojo.ready(slide);


</script></head><body>
<h1 id="greeting">
    Hello</h1></body></html>

Update: One diff might be that my script is not directly within parent directory of dojo root but in one of its child dir. If I place the dir within parent dir and changes the relative path it works.

4 Answers 4

1

i think

<script src=".\dojo-release-1.6.1\dojo\dojo.js"></script>

should be

<script src="./dojo-release-1.6.1/dojo/dojo.js"></script>
1
<script src="./dojo-release-1.6.1/dojo/dojo.js"></script>

That works for me (FF8 & Dojo 1.6.1)

0

This is my script.

   <script src="/resources/js/dojo/dojo.js"
    djConfig="parseOnLoad: true, 
              useCommentedJson:true,
              isDebug: false"></script>
0

I ran into a similar problem, what I did was:

1) Try to insert the tag between the head tags and change the backslashes to forward slashes

<head>
...
...
<script src="./dojo-release-1.6.1/dojo/dojo.js"></script>
</head>

2) Check whether you are sure the folder dojo-release-1.6.1 is in the same folder as the file.

3) check that you are not just simply opening the html file but you are running it on a server (e.g. Apache, tomcat etc...)

Not the answer you're looking for? Browse other questions tagged or ask your own question.