<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Trying to use the Dojo/domReady! function in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/trying-to-use-the-dojo-domready-function/m-p/102273#M9384</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is in regards to using the modern Dojo/domReady! function for initializing a script &amp;amp; map.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I was using the code:&amp;nbsp;&amp;nbsp; dojo.addOnLoad(init);&amp;nbsp;&amp;nbsp; to load the page and map; however, when replacing that with the newer:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;require(["dojo/domReady!"], function(init){});&amp;nbsp;&amp;nbsp; it does not appear to work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I also tried variations including:&amp;nbsp;&amp;nbsp; require(["dojo/domReady!"]);&amp;nbsp;&amp;nbsp; ... and putting it in different places in the code; but to no avail.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Do you have some examples on how to use this new Dojo syntax?&amp;nbsp;&amp;nbsp; Any suggestions on how to use it?&amp;nbsp; I can provide the code if desired.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Many thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 24 Apr 2013 16:03:54 GMT</pubDate>
    <dc:creator>JimLongwill</dc:creator>
    <dc:date>2013-04-24T16:03:54Z</dc:date>
    <item>
      <title>Trying to use the Dojo/domReady! function</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/trying-to-use-the-dojo-domready-function/m-p/102273#M9384</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is in regards to using the modern Dojo/domReady! function for initializing a script &amp;amp; map.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I was using the code:&amp;nbsp;&amp;nbsp; dojo.addOnLoad(init);&amp;nbsp;&amp;nbsp; to load the page and map; however, when replacing that with the newer:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;require(["dojo/domReady!"], function(init){});&amp;nbsp;&amp;nbsp; it does not appear to work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I also tried variations including:&amp;nbsp;&amp;nbsp; require(["dojo/domReady!"]);&amp;nbsp;&amp;nbsp; ... and putting it in different places in the code; but to no avail.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Do you have some examples on how to use this new Dojo syntax?&amp;nbsp;&amp;nbsp; Any suggestions on how to use it?&amp;nbsp; I can provide the code if desired.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Many thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Apr 2013 16:03:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/trying-to-use-the-dojo-domready-function/m-p/102273#M9384</guid>
      <dc:creator>JimLongwill</dc:creator>
      <dc:date>2013-04-24T16:03:54Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to use the Dojo/domReady! function</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/trying-to-use-the-dojo-domready-function/m-p/102274#M9385</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;dojo/domReady! only waits for the dom to load before returning. This is fine in most situations, but if you have dijits and other items that need to be loaded, it doesn't care if your dependencies are ready. If that is an issue, try using dojo/ready to wait for other dependencies to load.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;dojo/domReady&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://dojotoolkit.org/reference-guide/1.8/dojo/domReady.html"&gt;http://dojotoolkit.org/reference-guide/1.8/dojo/domReady.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;dojo/ready&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://dojotoolkit.org/reference-guide/1.8/dojo/ready.html"&gt;http://dojotoolkit.org/reference-guide/1.8/dojo/ready.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So with a brief, but clear explanation&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://stackoverflow.com/a/13144258"&gt;http://stackoverflow.com/a/13144258&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Apr 2013 16:13:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/trying-to-use-the-dojo-domready-function/m-p/102274#M9385</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2013-04-24T16:13:26Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to use the Dojo/domReady! function</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/trying-to-use-the-dojo-domready-function/m-p/102275#M9386</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;UL&gt;&lt;BR /&gt;&lt;/UL&gt;&lt;SPAN&gt;Thanks odoe,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I will use dojo/Ready as that *is* working at this point.&amp;nbsp; I've been seeking as much as possible to make my code V1.8 compliant; however, I can see that it will take some more experimenting to get Domo/domReady! to work.&amp;nbsp;&amp;nbsp; I am loading other modules including..&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dojo.require("dijit.dijit"); // optimize: load dijit layer&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dojo.require("dijit.layout.BorderContainer");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dojo.require("dijit.layout.ContentPane");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dojo.require("esri.map");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dojo.require("dijit.layout.TabContainer");&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dojo.require("esri.dijit.Legend"); &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Apr 2013 16:53:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/trying-to-use-the-dojo-domready-function/m-p/102275#M9386</guid>
      <dc:creator>JimLongwill</dc:creator>
      <dc:date>2013-04-24T16:53:30Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to use the Dojo/domReady! function</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/trying-to-use-the-dojo-domready-function/m-p/102276#M9387</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;What are you expecting to happen with this code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
require(["dojo/domReady!"], function(init){});
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That will not behave the same say way as:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
dojo.addOnLoad(init);
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you want to execute a function named init after the DOM is ready, use:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
require(["dojo/domReady!"], init);
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's a working example that creates a map:&amp;nbsp; &lt;/SPAN&gt;&lt;A href="http://jsfiddle.net/RyVE3/" rel="nofollow noopener noreferrer" target="_blank"&gt;http://jsfiddle.net/RyVE3/&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 06:18:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/trying-to-use-the-dojo-domready-function/m-p/102276#M9387</guid>
      <dc:creator>derekswingley1</dc:creator>
      <dc:date>2021-12-11T06:18:20Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to use the Dojo/domReady! function</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/trying-to-use-the-dojo-domready-function/m-p/102277#M9388</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm just starting out on all this, and I haven't figured out the syntax on the 'require' and context, etc.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the example.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Apr 2013 18:07:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/trying-to-use-the-dojo-domready-function/m-p/102277#M9388</guid>
      <dc:creator>JimLongwill</dc:creator>
      <dc:date>2013-04-24T18:07:11Z</dc:date>
    </item>
  </channel>
</rss>

