Error:  "TypeError: Cannot call method 'toString' of undefined" in Park and Recreation Finder

相关信息
Article ID: 40277
Software:
ArcGIS for Local Government 10.0
Platforms: N/A

错误信息
The following error message is returned in the Park and Recreation Finder application when one of the 'Share this map' options (Facebook, Twitter, or email) is clicked.

“TypeError: Cannot call method 'toString' of undefined?

This error applies to the
Park and Recreation Finder (ArcGIS 10) download.


错误原因
The share map options in the Park and Recreation Finder use a URL-compacting service called json-tinyurl.appspot.com. This service can fail when it reaches one of its daily quotas. When this happens, the share map feature fails until the service's usage counts are reset at 12:00 AM the next day.
已邀请:

EsriSupport

赞同来自:

解决方案
Change the application's URL-compacting service from using json-tinyurl.appspot.com to a different URL-compacting service.

One alternative service is bit.ly. If bit.ly is selected to replace json-tinyurl.appspot.com, it is necessary to make a one-time change to the Park Finder's software because bit.ly returns a more structured response. After this change, the software can handle either service: json-tinyurl.appspot.com or bit.ly.
  1. Navigate to ParkRecreationFinder > Application > ParkFinder and open Config.txt for editing.
  2. Replace the text "URL":
    "http://json-tinyurl.appspot.com/url=${0}" , "ResponseAttribute": "tinyurl",
     with
    "URL": "http://api.bit.ly/v3/shortenlo ... ri%3D${0}&format=json" , "ResponseAttribute": "data.url"
    and save the file.
  3. Open JS\Utils.js for editing.
  4. Delete line 83. 
    var tinyUrl = data[tinyURLServiceURL.ResponseAttribute];
  5. Insert the following lines in place of line 83
    var tinyUrl = data;// Follow a chain of nested attributes if necessaryvar attr = tinyURLServiceURL.ResponseAttribute.split(".");for (var x = 0; x < attr.length; x++) {tinyUrl = tinyUrl[attr[x]];}
     and save the file.


创建及修改时间
Created: 5/17/2012

Last Modified: 10/11/2013
原文链接
http://support.esri.com/en/kno ... 40277

要回复问题请先登录注册