Dojo themePreviewer stuck “Loading…”

2019-08-02 19:39发布

问题:

I downloaded the latest Dojo and Dijit to my local Windows 10 computer.

My disk structure is:

C:\webapps 
c:\webapps\dojo 
c:\webapps\demo 
c:\webapps\dijit 

I'm clicking on this file to load with Chrome browser: c:\webapps\demos\themePreviewer\demo.html

It shows the following, and is stuck forever with the "Loading..." message.

Internally, I see the following references to css files:

    <link rel="stylesheet" href="../../dijit/themes/claro/document.css"/>
    <link rel="stylesheet" href="../../dijit/themes/claro/claro.css"/>

I can see those on my disk, here:

c:\webapps\dijit\themes\claro\document.css 
c:\webapps\dijit\themes\claro\claro.css

Seems like it's a problem finding the files? But wouldn't Chrome debug tell me that? I also tried copying the dijit directory to:

c:\webapps\demo\dijit

Later I noticed there is one href in the program: href:'../../dijit/tests/layout/getResponse.php?delay=3000&messId=3'

that I changed to: href:'http://demos.dojotoolkit.org/dijit/tests/layout/getResponse.php?delay=3000&messId=3'

回答1:

Try to run the app from a localhost instead of file:///. In case the problem persist, you could debug it more and see if some dependencies are missing using Chrome Developer Tools > Network tab, in this way you should be able to identify any 404 errors.