Note that there are some explanatory texts on larger screens.

plurals
  1. POdojo.require() prevents Firefox from rendering the page
    primarykey
    data
    text
    <p>Im experiencing strange behavior with Firefox and Dojo. I have a html page with these lines in the &lt;head&gt; section:</p> <pre><code>... &lt;script type="text/javascript" src="dojo.js" djconfig="parseOnLoad: true, locale: 'de'"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; dojo.require("dojo.number"); &lt;/script&gt; ... </code></pre> <p>Sometimes the page loads normally. But sometimes it won't. Firefox will fetch the whole html page but not render it. I see only a gray window.</p> <p>After some experiments I figured out that the rendering problem has something to do with the load time of the html. Firefox starts evaluating the html page while loading it. If the page takes too long to load the above javascript will be executed BEFORE the html finishes loading.</p> <p>If this happens I'll get the gray window. Advising Firefox to show me the source code of the page will display the correct complete html code. BUT: if I save the page to disk (File->Save Page As...) the html code will be truncated and the above part will look like this:</p> <pre><code>... &lt;script type="text/javascript" src="dojo.js" djconfig="parseOnLoad: true, locale: 'de'"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; dojo.require("dojo.number"); &lt;/script&gt;&lt;/head&gt;&lt;body&gt;&lt;/body&gt;&lt;/html&gt; </code></pre> <p>This explains why I get to see a gray area. But why does this code appear there? I assume the require() method of Dojo does something "evil". But I can't figure out what. There is no write.document("&lt;/head&gt;&lt;body&gt;&lt;/body&gt;&lt;/html&gt;"); in the Dojo code. I checked for it.</p> <p>The problem would be fixed, if I'd place the dojo.require("dojo.number"); statement in the window.load event:</p> <pre><code>&lt;script type="text/javascript"&gt; window.load=function() { dojo.require("dojo.number"); } &lt;/script&gt; </code></pre> <p>But I'm curious why this happens. Is there a Javasctript function which forces Firefox to stop evaluating the page? Does Dojo do somethig "bad"? Can anyone explain this behavior to me?</p> <p>EDIT: Dojo 1.3.1, no JS errors or warnings.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload