<?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 Re: ReferenceError: event is not defined in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/referenceerror-event-is-not-defined/m-p/373002#M34607</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/297053"&gt;Jared Pilbeam&lt;/A&gt;&amp;nbsp;the code that Robert provided is fine, but if you don't want to use the dojo/on (which we have been removing from our samples to reduce dependencies), you could do a similar thing by just passing the &lt;STRONG&gt;event&amp;nbsp;&lt;/STRONG&gt;in the unnamed function. This also works fine across browsers, including Firefox. What is surprising is that Chrome and IE were smart enough to determine what the value of &lt;STRONG&gt;event&lt;/STRONG&gt; was supposed to be.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/432334_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 28 Dec 2018 16:52:19 GMT</pubDate>
    <dc:creator>Noah-Sager</dc:creator>
    <dc:date>2018-12-28T16:52:19Z</dc:date>
    <item>
      <title>ReferenceError: event is not defined</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/referenceerror-event-is-not-defined/m-p/373000#M34605</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A class="link-titled" href="https://webapp.willcountyillinois.com/attractions.html" title="https://webapp.willcountyillinois.com/attractions.html" rel="nofollow noopener noreferrer" target="_blank"&gt;Will County Attractions&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have an app that works as it should in Chrome and IE. In FireFox it doesn't.&lt;/P&gt;&lt;P&gt;The error in the console is pointing to a specific line (line 2:15 here) of the html:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; attTypeSelect.addEventListener("change", function () {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var type = event.target.value;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; setattractionsDefinitionExpression(type);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's what is (or isn't) happening:&lt;/P&gt;&lt;P&gt;When you choose a Type from the dropdown menu it will not populate on the map.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:15:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/referenceerror-event-is-not-defined/m-p/373000#M34605</guid>
      <dc:creator>JaredPilbeam2</dc:creator>
      <dc:date>2021-12-11T17:15:00Z</dc:date>
    </item>
    <item>
      <title>Re: ReferenceError: event is not defined</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/referenceerror-event-is-not-defined/m-p/373001#M34606</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jared,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; I always use dojo/on for this:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;// set a new definitionExpression on the attractions layer&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="token function"&gt;on&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;attTypeSelect&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"change"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;function&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;event&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; type &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; event&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;target&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;value&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="token function"&gt;setattractionsDefinitionExpression&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;type&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I tested in FireFox and it works fine.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:15:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/referenceerror-event-is-not-defined/m-p/373001#M34606</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-12-11T17:15:03Z</dc:date>
    </item>
    <item>
      <title>Re: ReferenceError: event is not defined</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/referenceerror-event-is-not-defined/m-p/373002#M34607</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/297053"&gt;Jared Pilbeam&lt;/A&gt;&amp;nbsp;the code that Robert provided is fine, but if you don't want to use the dojo/on (which we have been removing from our samples to reduce dependencies), you could do a similar thing by just passing the &lt;STRONG&gt;event&amp;nbsp;&lt;/STRONG&gt;in the unnamed function. This also works fine across browsers, including Firefox. What is surprising is that Chrome and IE were smart enough to determine what the value of &lt;STRONG&gt;event&lt;/STRONG&gt; was supposed to be.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/432334_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Dec 2018 16:52:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/referenceerror-event-is-not-defined/m-p/373002#M34607</guid>
      <dc:creator>Noah-Sager</dc:creator>
      <dc:date>2018-12-28T16:52:19Z</dc:date>
    </item>
  </channel>
</rss>

