title: undefined value when getting value from json variable
body: <p>I have a c# webservice that returns json data.  Here is the data that is being returned.</p>
  
  <pre><code>[ { "destination": "pandora.com", "hits": 9 }, 
  { "destination": "google.com", "hits": 2 }, 
  { "destination": "msftncsi.com", "hits": 2 }, 
  { "destination": "nmlsconsumeraccess.org", "hits": 1 }, 
  { "destination": "facebook.com", "hits": 1 }, 
  { "destination": "gravatar.com", "hits": 1 }, 
  { "destination": "iheart.com", "hits": 1 }, 
  { "destination": "kiss1041fm.com", "hits": 1 }, 
  { "destination": "live.com", "hits": 1 }, 
  { "destination": "microsoft.com", "hits": 1 }, 
  { "destination": "today.com", "hits": 1 }, 
  { "destination": "update.microsoft.com", "hits": 1 }, 
  { "destination": "xsitesnetwork.com", "hits": 1 }, 
  { "destination": "youtube-nocookie.com", "hits": 1 }, 
  { "destination": "youtube.com", "hits": 1 }, 
  { "destination": "zillow.com", "hits": 1 } ]
  </code></pre>
  
  <p>Here is my javascript:</p>
  
  <pre><code>ret = Convert2Json.Convert(OnComplete, OnTimeOut, OnError); //this is my webservice
  
  function OnComplete(arg) {
  
      $('#label').text(arg); //when I set this label to arg
      //I get the json data correctly as above
  
      var list = {
          "entries": arg
      };
  
      alert(list.entries[0].destination);
      //this gives me undefined when it popups
  }
  
  function OnTimeOut(arg) {
      alert("TimeOut encountered when calling server");
  }
  
  function OnError(arg) {
      alert("Error encountered when calling server");
  }
  </code></pre>
  
  <p>If I define list myself as follows, it works:</p>
  
  <pre><code>var list = { "entries": [{ "destination": "pandora.com", "hits": 9 }, { "destination": "google.com", "hits": 2 }, { "destination": "youtube.com", "hits": 2 }, { "destination": "facebook.com", "hits": 1 }, { "destination": "fdic.gov", "hits": 1 }, { "destination": "GOV_new", "hits": 1 }, { "destination": "iheart.com", "hits": 1 }, { "destination": "jcpportraits.com", "hits": 1 }, { "destination": "kiss1041fm.com", "hits": 1 }, { "destination": "live.com", "hits": 1 }, { "destination": "msftncsi.com", "hits": 1 }, { "destination": "publix.com", "hits": 1 }, { "destination": "today.com", "hits": 1 }, { "destination": "xsitesnetwork.com", "hits": 1 }, { "destination": "youtube-nocookie.com", "hits": 1 }] };
  </code></pre>
  
  <p>Here is what Convert2Json.Convert does</p>
  
  <pre><code>[WebMethod]
  [ScriptMethod(ResponseFormat = ResponseFormat.Json)]
  public string Convert() {
  
  
  
  
      using (SqlConnection conn = new SqlConnection("Server=localhost;Initial Catalog=Testing_Server;Trusted_Connection=True;"))
      {
  
          SqlCommand cmd = new SqlCommand("SELECT Destination as destination, count(distinct(source)) as hits FROM [Carlos_Test] where GETDATE() &lt; DATEADD(MINUTE,5,time) and destination not in ('google-analytics.com','gstatic.com','googleadservices.com','download.windowsupdate.com') group by Destination order by hits DESC", conn);
  
  
  
  
          conn.Open();
  
  
          List&lt;VisitedSites&gt; slist = new List&lt;VisitedSites&gt;();
  
          SqlDataReader reader = cmd.ExecuteReader();
  
          while (reader.Read()) {
  
  
  
              VisitedSites vs = new VisitedSites();
              vs.destination = reader["destination"].ToString();
              vs.hits = Int32.Parse(reader["hits"].ToString());
  
              slist.Add(vs);
  
          }
  
  
  
  
  
          string jSon = JsonConvert.SerializeObject(slist, Formatting.Indented);
  
  
          return jSon;
      }
  
  
  
  }
  
  public class VisitedSites {
  
      public string destination;
      public int hits;
  
  
  }
  </code></pre>