<?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 Error when attempting to use on(dom.byId.... in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/error-when-attempting-to-use-on-dom-byid/m-p/186597#M17336</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When I add the following block of code:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;on(dom.byId("btnCancelFeedback"), "click", function () {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; document.getElementById("feedbackModal").style.visibility = 'hidden';
&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/PRE&gt;&lt;P&gt;I receive an error as follows:&lt;/P&gt;&lt;P class="section" style="margin: 0 0 0 12px !important;"&gt;&lt;/P&gt;&lt;DIV class="header monospace" style="padding: 0 8px 0 0;"&gt;&lt;DIV class="title" style="color: #222222;"&gt;TypeError: Cannot read property 'on' of null&lt;P&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000; font-family: Consolas, 'Lucida Console', monospace; font-size: 12px;"&gt; &lt;/SPAN&gt;&lt;SPAN class="source-code" style="font-family: Consolas, 'Lucida Console', monospace; font-size: 12px; color: #ff0000;"&gt;"&lt;SPAN class="console-formatted-string source-code" style="color: #c41a16;"&gt;in domReady callback&lt;/SPAN&gt;"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000; font-family: Consolas, 'Lucida Console', monospace; font-size: 12px;"&gt; &lt;/SPAN&gt;&lt;SPAN class="source-code" style="font-family: Consolas, 'Lucida Console', monospace; font-size: 12px; color: #ff0000;"&gt;"&lt;SPAN class="console-formatted-string source-code" style="color: #c41a16;"&gt;TypeError: Cannot read property 'on' of null&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have used this method in the past with no issues including inside this project, but this causes an error. Any ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is my complete app on github:&lt;A href="https://github.com/csergent45/streetSigns" rel="nofollow noopener noreferrer" target="_blank"&gt;https://github.com/csergent45/streetSigns&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The JavaScript is in app/main.js&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 09:27:28 GMT</pubDate>
    <dc:creator>ChrisSergent</dc:creator>
    <dc:date>2021-12-11T09:27:28Z</dc:date>
    <item>
      <title>Error when attempting to use on(dom.byId....</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/error-when-attempting-to-use-on-dom-byid/m-p/186597#M17336</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When I add the following block of code:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;on(dom.byId("btnCancelFeedback"), "click", function () {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; document.getElementById("feedbackModal").style.visibility = 'hidden';
&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/PRE&gt;&lt;P&gt;I receive an error as follows:&lt;/P&gt;&lt;P class="section" style="margin: 0 0 0 12px !important;"&gt;&lt;/P&gt;&lt;DIV class="header monospace" style="padding: 0 8px 0 0;"&gt;&lt;DIV class="title" style="color: #222222;"&gt;TypeError: Cannot read property 'on' of null&lt;P&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000; font-family: Consolas, 'Lucida Console', monospace; font-size: 12px;"&gt; &lt;/SPAN&gt;&lt;SPAN class="source-code" style="font-family: Consolas, 'Lucida Console', monospace; font-size: 12px; color: #ff0000;"&gt;"&lt;SPAN class="console-formatted-string source-code" style="color: #c41a16;"&gt;in domReady callback&lt;/SPAN&gt;"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000; font-family: Consolas, 'Lucida Console', monospace; font-size: 12px;"&gt; &lt;/SPAN&gt;&lt;SPAN class="source-code" style="font-family: Consolas, 'Lucida Console', monospace; font-size: 12px; color: #ff0000;"&gt;"&lt;SPAN class="console-formatted-string source-code" style="color: #c41a16;"&gt;TypeError: Cannot read property 'on' of null&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have used this method in the past with no issues including inside this project, but this causes an error. Any ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is my complete app on github:&lt;A href="https://github.com/csergent45/streetSigns" rel="nofollow noopener noreferrer" target="_blank"&gt;https://github.com/csergent45/streetSigns&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The JavaScript is in app/main.js&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:27:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/error-when-attempting-to-use-on-dom-byid/m-p/186597#M17336</guid>
      <dc:creator>ChrisSergent</dc:creator>
      <dc:date>2021-12-11T09:27:28Z</dc:date>
    </item>
    <item>
      <title>Re: Error when attempting to use on(dom.byId....</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/error-when-attempting-to-use-on-dom-byid/m-p/186598#M17337</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is what ended up working:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;on(dom.byId("btnCancelFeedback"), "click", function () {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; query("#feedbackModal").modal("hide");
&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The other thing that worked is when I changed removed the double quotes from feedbackModal and replaced them with single quotes.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:27:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/error-when-attempting-to-use-on-dom-byid/m-p/186598#M17337</guid>
      <dc:creator>ChrisSergent</dc:creator>
      <dc:date>2021-12-11T09:27:31Z</dc:date>
    </item>
  </channel>
</rss>

