Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8691889
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:12:51+00:00 2026-06-13T00:12:51+00:00

A while back, I looked into a solution for the flash of unstyled content

  • 0

A while back, I looked into a solution for the “flash of unstyled content” when using Dojo and Dojo themes. Someone suggested to combine everything by creating a build, and it’ll reduce the load/parse time and remove the need to use preloader overlays, etc.

However, it seems like Dojo is severely lacking in straightforward, “real world” useage examples and tutorials for a lot of its functionality, this especially. A lot of the resources tell you how to set up a build, but not how to implement it.

Let’s say I have this in “pageinit.js”:

require([
    'dojo/parser', 
    'dojo/dom',
    'dojo/dom-class',
    //etc...

    'dijit/form/ValidationTextBox', 
    'dijit/form/CheckBox',
    // etc...

    // Dom Ready call
    'dojo/domReady!']
    function(
        Parser, 
        Dom,
        Class,
        // etc...){
    // do stuff with parser, dijits, so on.
    }
)

Some of the require calls were removed for brevity, but there’s a handful of dom requires, style classes, some dijits, etc. When this page loads, there’s the flash of unstyled content and then it’s fine.

Using the Dojo Web Builder, I selected the modules I’m using, and ran it. It downloaded a zip with a lot of files under it, including a new dojo.js and custom_layer.js.

So my question is now, how do I use these new combined and minified files in place of my “non-build” version? What do I require? Or do I?

So confused…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T00:12:52+00:00Added an answer on June 13, 2026 at 12:12 am

    First, let’s understand how the AMD(require/define) API works.

    require([
      'dojo/parser', 
      'dojo/dom',
      'dojo/dom-class'
    ], function(parser, dom, domClass){
    });
    

    This is going to call the require function, specifying that I need three modules in order to do some work. require will get each module. If will determine if the module has been loaded. If it hasn’t it will asynchronously get the file, and load the module into the javascript runtime. Once require has retrieved all of your required modules, it will execute your callback (the function) passing the modules as arguments to the function.

    Next, let’s understand the build. The dojo build does exactly what you describe. It will compress a bunch of the individual files into a single file. this will make the page load quicker and prevent that ‘flash’ that you describe.

    Finally, putting it all together, you should include the custom_layer.js file along with the dojo.js file.

    <script type="text/javascript" src="path/to/dojo/dojo.js" />
    <script type="text/javascript" src="path/to/custom_layer.js" />
    

    The web browser will load these two files and evaluate the code. Instead of lazily loading each module in it’s own file, the module will already be loaded because it was defined in the custom_layer.js.

    So, the answer to your final question is that you should NOT change any of your code based on the specific version of code (source vs custom build) that you are using. Using the AMD api, it should just work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

A while back, I remember using a piece of code (4-5 lines), added to
A while back, smart clients had been touted as the solution to occasional connected
A while back I wrote a simple python program to brute-force the single solution
A while back I created a lightbox plugin using jQuery that would load a
A while back I was playing with methods using variable-length argument lists (java) that
This was something I looked at a while back but couldn't figure it out.
A while back i read somewhere about how to improve upon the MVC pattern
A while back a found a great-looking framework that allowed .net developers to implement
a while back, CNET had these really cool Social Share buttons, that when you
I remember a while back reading about editing the proxy pac file which would

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.