Install the JavaScript API for use with ArcGIS 10.2 for Server


When using ArcGIS for Server in an isolated or secure environment, it may not be possible to access the hosted Esri JavaScript API libraries. This article provides a walkthrough for installing a local copy of the JavaScript API and configuring it for use with ArcGIS 10.2 for Server.


 This document assumes that Microsoft IIS is being used as the web server. If using a different program, some steps may not apply or may be different based on that configuration. Please consult that software’s documentation if needed.

Download and install the JavaScript API

1. Navigate to the ArcGIS API for JavaScript page.

2. Under the Download section, click the link to the ArcGIS API for JavaScript section of the Esri Download page.


3. Scroll down to the latest ArcGIS API for JavaScript API release (currently v3.8).

4. Click the ‘’ link and log in with an Esri Global Account username and password.


5. Accept the License Agreement to start the download. -show me-


Modify JavaScript files

1. Unzip the contents of the .zip file to a temporarily location. -show me-

 This may take a few minutes. While not physically large, the .zip file contains approximately 17K files that must be extracted.

2. Copy the arcgis_js_api folder into the web server root folder, typically:

 Please note in the following two steps, do not include ‘http://’ with the fully qualified host name as this is already defined in the two files.

3. Open the following file in a text editor:


4. Search for the text ‘[HOSTNAME_AND_PATH_TO_JSAPI]’, and replace this text with:


5. Open the following file in a text editor:


6. Search for the text ‘[HOSTNAME_AND_PATH_TO_JSAPI]’, and replace this text with:


Add IIS default document

1. Open IIS and navigate to the Default Web Site.

2. Open the Default Document. -show me-


3. Under the Actions heading, click Add. -show me-


4. Type init.js as the name value, and click OK. -show me-


Init.js should now be listed as a Local Entry Type default document. -show me-


Edit ArcGIS services

1. In a web browser on the server navigate to the following location:


2. Login with administrator credentials. -show me-


3. Copy or take a screenshot of the current Services Directory settings in case it is necessary to revert to the default settings.

4. Click ‘edit’ to modify settings. -show me-


5. Replace each of the following fields with the path to the local installation of the JavaScript API using the fully qualified host name in place of the following examples:

• Javascript API URL:

• Javascript API CSS URL:

• Javascript API CSS2 URL:

-show me-

 If your server is configured to use HTTPS only, modify the examples above to use HTTPS instead of HTTP as the URL connection.

6. Clear the browser cache to complete installation.

 To confirm that ArcGIS for Server is using the correct settings for the JavaScript API, open a web debugging program and preview a map service using the ArcGIS JavaScript viewer from the Services Directory (REST). If configured correctly, the viewer should load successfully and all URLs listed in the web debugger are from the local web server and not from ‘’

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s