<?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 map.on vs dojo/on in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-on-vs-dojo-on/m-p/119896#M11155</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;map.on("load", doSomething);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;on(map, "load", doSomething);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a difference between the above statements.&amp;nbsp; I've seen both in the samples and I was curious.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 12 May 2014 18:08:03 GMT</pubDate>
    <dc:creator>CurtisSpurlock</dc:creator>
    <dc:date>2014-05-12T18:08:03Z</dc:date>
    <item>
      <title>map.on vs dojo/on</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-on-vs-dojo-on/m-p/119896#M11155</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;map.on("load", doSomething);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;on(map, "load", doSomething);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a difference between the above statements.&amp;nbsp; I've seen both in the samples and I was curious.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 May 2014 18:08:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-on-vs-dojo-on/m-p/119896#M11155</guid>
      <dc:creator>CurtisSpurlock</dc:creator>
      <dc:date>2014-05-12T18:08:03Z</dc:date>
    </item>
    <item>
      <title>Re: map.on vs dojo/on</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-on-vs-dojo-on/m-p/119897#M11156</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;For just listening for events, no.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Map extends dojo/Evented, so that allows you to do use it like map.on() to listen for events. It also allows you to use dojo/on to listen for events on the map.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The added benefit of using dojo/on is it provides a little more utility, like pausable handlers.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;var handler = on.pausable(map, 'click', method);
handler.pause();
// some other stuff happens
handler.resume();&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;Or you could listen to events only once.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;on.once(map, 'load', method);&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So it all depends on what you are looking to do. I would recommend using the dojo/on method, simply for consistency as you will probably use it to listen for other events as well.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 06:59:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-on-vs-dojo-on/m-p/119897#M11156</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2021-12-11T06:59:19Z</dc:date>
    </item>
    <item>
      <title>Re: map.on vs dojo/on</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-on-vs-dojo-on/m-p/119898#M11157</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Great!&amp;nbsp; Thanks for the information.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 May 2014 17:08:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-on-vs-dojo-on/m-p/119898#M11157</guid>
      <dc:creator>CurtisSpurlock</dc:creator>
      <dc:date>2014-05-13T17:08:37Z</dc:date>
    </item>
    <item>
      <title>Re: map.on vs dojo/on</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-on-vs-dojo-on/m-p/119899#M11158</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm stuck with having to have my code work in IE 8, and I've had less problems with map.on syntax vs the on syntax.&amp;nbsp; I really wish we could get off it as our default browser, but for now we're stuck with it.&amp;nbsp; At least now they let users have something besides IE!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 May 2014 20:10:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-on-vs-dojo-on/m-p/119899#M11158</guid>
      <dc:creator>TracySchloss</dc:creator>
      <dc:date>2014-05-13T20:10:36Z</dc:date>
    </item>
  </channel>
</rss>

