<?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 Write a normal JavaScript function in AMD module. in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/write-a-normal-javascript-function-in-amd-module/m-p/190274#M17570</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know this question is regarding pure Dojo but still I'm asking for help because I have just started to learn JavaScript API.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In a custom AMD Dojo module,we write a module function like below and we call it from somewhere.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class="javascript" name="code"&gt;addMapService:function(url,mapControl){ &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //add map service&amp;nbsp; }, &lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I want to know how we go about writing a normal Javascript function in AMD module as below;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class="javascript" name="code"&gt;function addMapService(url,mapControl){ &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //add map service&amp;nbsp; }&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The reason I'm asking this, we need lot of private helper functions in AMD module,so instead of creating another helper AMD module,I'm looking for a way to write the normal JavaScript function in a module itself.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;S.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 10 Feb 2015 05:51:51 GMT</pubDate>
    <dc:creator>SanajyJadhav</dc:creator>
    <dc:date>2015-02-10T05:51:51Z</dc:date>
    <item>
      <title>Write a normal JavaScript function in AMD module.</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/write-a-normal-javascript-function-in-amd-module/m-p/190274#M17570</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know this question is regarding pure Dojo but still I'm asking for help because I have just started to learn JavaScript API.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In a custom AMD Dojo module,we write a module function like below and we call it from somewhere.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class="javascript" name="code"&gt;addMapService:function(url,mapControl){ &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //add map service&amp;nbsp; }, &lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I want to know how we go about writing a normal Javascript function in AMD module as below;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class="javascript" name="code"&gt;function addMapService(url,mapControl){ &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //add map service&amp;nbsp; }&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The reason I'm asking this, we need lot of private helper functions in AMD module,so instead of creating another helper AMD module,I'm looking for a way to write the normal JavaScript function in a module itself.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;S.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Feb 2015 05:51:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/write-a-normal-javascript-function-in-amd-module/m-p/190274#M17570</guid>
      <dc:creator>SanajyJadhav</dc:creator>
      <dc:date>2015-02-10T05:51:51Z</dc:date>
    </item>
    <item>
      <title>Re: Write a normal JavaScript function in AMD module.</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/write-a-normal-javascript-function-in-amd-module/m-p/190275#M17571</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can write your normal javascript functions in a separate js file and link it to your page and by this way all the functions in the js file will be accessible from any AMD module that will be loaded in the same page.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Although i prefer to create a helper AMD module to make your code fully object oriented.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Feb 2015 06:27:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/write-a-normal-javascript-function-in-amd-module/m-p/190275#M17571</guid>
      <dc:creator>MohammedEl_Shafaey</dc:creator>
      <dc:date>2015-02-10T06:27:26Z</dc:date>
    </item>
    <item>
      <title>Re: Write a normal JavaScript function in AMD module.</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/write-a-normal-javascript-function-in-amd-module/m-p/190276#M17572</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Mohammed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Feb 2015 13:16:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/write-a-normal-javascript-function-in-amd-module/m-p/190276#M17572</guid>
      <dc:creator>SanajyJadhav</dc:creator>
      <dc:date>2015-02-11T13:16:18Z</dc:date>
    </item>
  </channel>
</rss>

