title: Get element of a responseText JSON of an OpenLayers GET request
body: <p>I am trying to use <code>OpenLayers.Request.GET</code> to load data from url in JSON format. </p>
  
  <p>Here's the request (note: url works fine, it brings data in JSON format):</p>
  
  <pre><code>var request = OpenLayers.Request.GET({
      url: "http://localhost:8080/geoserver/wrspc/ows?service=WFS&amp;version=1.0.0&amp;request=GetFeature&amp;typeName=wrspc:layer1&amp;maxFeatures=60&amp;outputFormat=json",
      callback: handler
  });
  </code></pre>
  
  <p>for the handler I tried to get the <code>request.responseText</code> and show a specific key in the json file like this: </p>
  
  <pre><code>var obj;
  
  function handler(request) {
      obj = request.responseText;
      alert (obj.features[0].indicator);
  }
  </code></pre>
  
  <p>and here's my JSON:</p>
  
  <pre><code> {"type":"FeatureCollection","features":[{"type":"Feature","id":"titid","geometry":{"type":"MultiPolygon","coordinates":[[[[3694.7863290442,3749.0463695516],[9328.2052648721,3756.61081112875],[3694.18117371807,3861.9059202327],[9340.68659347435,3834.4171230714],[9334.7863290442,3749.0463695516],[3634.7863290442,3839.0463695516]]]]},"geometry_name":"the_geom","properties":{"name1":"asme","number":9130,"indicator":"20","gid":939}}],"crs":{"type":"EPSG","properties":{"code":"2684"}}}
  </code></pre>
  
  <p>but I get this error: (note the TestPrint.html:506 is the alert line)</p>
  
  <pre class="lang-none prettyprint-override"><code> Uncaught TypeError: Cannot read property '0' of undefined TestPrint.html:506
   GeoExt.form.FormPanel.listeners.actioncomplete TestPrint.html:506
   h.Event.fire ext-all.js:21
   h.Observable.fireEvent ext-all.js:21
   (anonymous function) ext-all.js:21
    h.Event.fire ext-all.js:21
    h.Observable.fireEvent ext-all.js:21
    Ext.form.BasicForm.Ext.extend.afterAction ext-all.js:21
    GeoExt.form.SearchAction.Ext.extend.handleResponse SearchAction.js:147
    OpenLayers.Protocol.WFS.v1.OpenLayers.Class.handleRead OpenLayers.js:843
    (anonymous function) OpenLayers.js:413
    (anonymous function) OpenLayers.js:62
    OpenLayers.Request.runCallbacks OpenLayers.js:509
    d.onreadystatechange OpenLayers.js:508
    b.dispatchEvent OpenLayers.js:751
    c OpenLayers.js:744
    _object.onreadystatechange OpenLayers.js:748
  </code></pre>