title: TypeError: a is undefined in jquery at the first line?
body: <p>So, in my code, when I press my #jsonclick button, it activates my script which populates a table with information from a JSON page. The problem I am having is that I am getting a TypeError: a is undefined, and I have no idea why.
  Here is my code:</p>
  
  <p>jQuery function</p>
  
  <pre><code>   $("#clickjson").click(function () {
      $.getJSON("gmessagegroup.php?gid=" + $('#gbox').val(), function (data) {
          $.each(data.messages, function (key, val) {
              if (data.messages[key].clientmessageid != undefined) {
                  console.log(data.messages[key].clientmessageid + ":" + data.messages[key].from + " - " + data.messages[key].content);
                  $("#messages tbody tr:last").after('&lt;tr&gt;&lt;td&gt;' + data.messages[key].clientmessageid + '&lt;/td&gt;&lt;td&gt;' + escapeHtml(data.messages[key].from).replace("https://bn1-client-s.gateway.messenger.live.com/v1/users/ME/contacts/8:", "") + '&lt;/td&gt;&lt;td id=' + data.messages[key].clientmessageid + ' contenteditable="true"&gt;' + escapeHtml(data.messages[key].content) + '&lt;/td&gt;&lt;/tr&gt;');
              }
          });
      });
  
      setTimeout(function () {
          var message_status = $("#status");
          $("td[contenteditable=true]").blur(function () {
              var field_userid = $(this).attr("id");
              var value = $(this).text();
              $.post('groupedit.php', field_userid + "=" + value, function (data) {});
          });
  
      }, 1000);
  });
  </code></pre>
  
  <p>The code is getting the value of the selected item in a dropdown select. I tried putting and alert in and it is putting out the correct value that is being pushed out to the PHP. I am unsure of where the TypeError comes into play, all I know is that when I remove ?gid=" + $('#gbox').val() from the end of the php, the error goes away. Problem is, I need that for the php to work. Can somebody please tell me why this is happening?</p>
  
  <p>Thanks.</p>