English

How To: Disable debug feature (debug=true) in HTML Viewer

Summary

The Debug feature in HTML Viewer is very useful while customizing or testing the viewer but is not a good idea to publish pages with this feature still on. One possible issue is that a user who is familiar with the HTML Viewer might see the ArcXML request and the response being generated. This article shows how to disable the debug=true passed via the URL.

Note:
There are two ways to turn on debugging in HTML Viewer.

1. Specifying the value for 'setDebug' variable to be True in ArcIMSParam.js file.

2. Specifying debug=true in the URL while opening the HTML Viewer:

Code:
http://myserver.com/myviewer/default.htm?debug=true

This article discusses the second method.

Procedure

The steps shown are for the out-of-the-box or default HTML Viewer generated by the ArcIMS Designer:

  1. Navigate to the <website>/javascript directory and Open file aimsMap.js in any text editor.
  2. Locate the following code:

    Code:
    pos = cmdString2.indexOf("debug=YES");
    if (pos==-1)
    pos = cmdString2.indexOf "debug=TRUE");
    if (pos!=-1) {
    debugOn=3;
    }

  3. Comment the 'debugOn=3' statement as shown below

    Code:
    pos = cmdString2.indexOf("debug=YES");
    if (pos==-1)
    pos = cmdString2.indexOf("debug=TRUE");
    if (pos!=-1) {
    //Commented to stop showing debug statements
    //debugOn=3;
    }

  4. Save the file.