<?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: Switch statement JS - Typeerror e is null - in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/switch-statement-js-typeerror-e-is-null/m-p/745342#M68953</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Good to hear it is working.&lt;BR /&gt;&lt;BR /&gt;Debugging JS can be a pain. Chrome developer tools can be really helpful for these type of issues: &lt;A href="https://developer.chrome.com/devtools/index"&gt;https://developer.chrome.com/devtools/index&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Also - make sure to remove all of the console.log() lines from your final code as they can cause issues in old versions of IE.&lt;BR /&gt;&lt;BR /&gt;Owen&lt;BR /&gt;&lt;A _jive_internal="true" href="https://community.esri.com/www.spatialxp.com.au"&gt;www.spatialxp.com.au&lt;/A&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the tips. Will keep that in mind from now on.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Alex&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 10 Jun 2014 14:51:14 GMT</pubDate>
    <dc:creator>AlexGole1</dc:creator>
    <dc:date>2014-06-10T14:51:14Z</dc:date>
    <item>
      <title>Switch statement JS - Typeerror e is null -</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/switch-statement-js-typeerror-e-is-null/m-p/745338#M68949</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to create a GIS data portal that allows users to select one out three diffent methods for data extraction.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1) extract by graphic extent&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2) extract by extent of a county&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3) extract by unit (calfire)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; I am using a switch statement that allow the users to select either one of these methods independently as shown on this &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://forums.arcgis.com/threads/110929-Switch-statement-JS?p=393527#post393527" rel="nofollow" target="_blank"&gt;thread&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The 1st extraction method works fine&amp;nbsp; but the two next return an error in firefox is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;TypeError: e is null http://js.arcgis.com/3.9/ Line 136&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The error in internet explorer error is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;TypeError: Unable to get property 'style' of undefined or null reference&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can access a template of my app here:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A class="jive-link-external-small" href="http://testegis.fire.ca.gov/its/alexapps/clipandship/index.html" rel="nofollow" target="_blank"&gt;http://testegis.fire.ca.gov/its/alexapps/clipandship/index.html&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The code itself is here:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A class="jive-link-external-small" href="http://jsbin.com/rozic/1/edit" rel="nofollow" target="_blank"&gt;http://jsbin.com/rozic/1/edit&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If any of you have ideas how to solve this. That would be very helpful!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Alex&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jun 2014 20:29:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/switch-statement-js-typeerror-e-is-null/m-p/745338#M68949</guid>
      <dc:creator>AlexGole1</dc:creator>
      <dc:date>2014-06-09T20:29:28Z</dc:date>
    </item>
    <item>
      <title>Re: Switch statement JS - Typeerror e is null -</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/switch-statement-js-typeerror-e-is-null/m-p/745339#M68950</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This issue appears to be related to your loading images.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;&amp;lt;script type="text/javascript"&amp;gt;&amp;nbsp; ...&amp;nbsp; // Keep a reference to the loading icon DOM node.&amp;nbsp; var loading = dom.byId("loading");&amp;nbsp; var loading1 = dom.byId("loading1");&amp;nbsp; var loading2 = dom.byId("loading2");&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In your HTML there is an image element with id="loading2":&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;&amp;lt;img id="loading2" src="images/loading2.gif"&amp;gt;&amp;lt;/img&amp;gt;&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, there are no elements with ids of "loading" or "loading1" in the page.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Your extractByCounty function attempts to show the element with id "loading":&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;domStyle.set(loading, "display", "inline-block");&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Your extractByUnit function attempts to show the element with id "loading1":&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;domStyle.set(loading1, "display", "inline-block");&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In both cases these elements do not exist in the HTML so you are getting the 'e is null' error when the Javascript code attempts to set the style of the element.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You could either change the Javascript to use the same loading image element ("loading2") or create the other two HTML image elements to fix the issue.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Owen&lt;/SPAN&gt;&lt;BR /&gt;&lt;A _jive_internal="true" class="" href="https://community.esri.com/www.spatialxp.com.au"&gt;www.spatialxp.com.au&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jun 2014 22:08:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/switch-statement-js-typeerror-e-is-null/m-p/745339#M68950</guid>
      <dc:creator>OwenEarley</dc:creator>
      <dc:date>2014-06-09T22:08:28Z</dc:date>
    </item>
    <item>
      <title>Re: Switch statement JS - Typeerror e is null -</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/switch-statement-js-typeerror-e-is-null/m-p/745340#M68951</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;This issue appears to be related to your loading images.&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;lt;script type="text/javascript"&amp;gt;
 ...
 // Keep a reference to the loading icon DOM node.
 var loading = dom.byId("loading");
 var loading1 = dom.byId("loading1");
 var loading2 = dom.byId("loading2");&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;In your HTML there is an image element with id="loading2":&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;lt;img id="loading2" src="images/loading2.gif"&amp;gt;&amp;lt;/img&amp;gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;However, there are no elements with ids of "loading" or "loading1" in the page.&lt;BR /&gt;&lt;BR /&gt;Your extractByCounty function attempts to show the element with id "loading":&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;domStyle.set(loading, "display", "inline-block");&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;Your extractByUnit function attempts to show the element with id "loading1":&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;domStyle.set(loading1, "display", "inline-block");&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;In both cases these elements do not exist in the HTML so you are getting the 'e is null' error when the Javascript code attempts to set the style of the element.&lt;BR /&gt;&lt;BR /&gt;You could either change the Javascript to use the same loading image element ("loading2") or create the other two HTML image elements to fix the issue.&lt;BR /&gt;&lt;BR /&gt;Owen&lt;BR /&gt;&lt;A _jive_internal="true" href="https://community.esri.com/www.spatialxp.com.au" target="_blank"&gt;www.spatialxp.com.au&lt;/A&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;That was it! Thank you Owen for all your help! Thanks to you I was able this data portal work. I am keeping your website in memory and will pass it along to other coworkers. You seem to&amp;nbsp; be very good at developping JS apps like these. Thank you again! Alex&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:42:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/switch-statement-js-typeerror-e-is-null/m-p/745340#M68951</guid>
      <dc:creator>AlexGole1</dc:creator>
      <dc:date>2021-12-12T07:42:47Z</dc:date>
    </item>
    <item>
      <title>Re: Switch statement JS - Typeerror e is null -</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/switch-statement-js-typeerror-e-is-null/m-p/745341#M68952</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Good to hear it is working.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Debugging JS can be a pain. Chrome developer tools can be really helpful for these type of issues: &lt;/SPAN&gt;&lt;A href="https://developer.chrome.com/devtools/index"&gt;https://developer.chrome.com/devtools/index&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also - make sure to remove all of the console.log() lines from your final code as they can cause issues in old versions of IE.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Owen&lt;/SPAN&gt;&lt;BR /&gt;&lt;A _jive_internal="true" href="https://community.esri.com/www.spatialxp.com.au"&gt;www.spatialxp.com.au&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jun 2014 23:14:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/switch-statement-js-typeerror-e-is-null/m-p/745341#M68952</guid>
      <dc:creator>OwenEarley</dc:creator>
      <dc:date>2014-06-09T23:14:03Z</dc:date>
    </item>
    <item>
      <title>Re: Switch statement JS - Typeerror e is null -</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/switch-statement-js-typeerror-e-is-null/m-p/745342#M68953</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Good to hear it is working.&lt;BR /&gt;&lt;BR /&gt;Debugging JS can be a pain. Chrome developer tools can be really helpful for these type of issues: &lt;A href="https://developer.chrome.com/devtools/index"&gt;https://developer.chrome.com/devtools/index&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Also - make sure to remove all of the console.log() lines from your final code as they can cause issues in old versions of IE.&lt;BR /&gt;&lt;BR /&gt;Owen&lt;BR /&gt;&lt;A _jive_internal="true" href="https://community.esri.com/www.spatialxp.com.au"&gt;www.spatialxp.com.au&lt;/A&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the tips. Will keep that in mind from now on.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Alex&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jun 2014 14:51:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/switch-statement-js-typeerror-e-is-null/m-p/745342#M68953</guid>
      <dc:creator>AlexGole1</dc:creator>
      <dc:date>2014-06-10T14:51:14Z</dc:date>
    </item>
  </channel>
</rss>

