title: Issues with javascript code, JSON request from Github
body: <p>I'm having an issue getting this to work. 
  I'm still very new to JS and learning the syntax. I'm attempting to modify someone's script that was built to return <strong>ALL</strong> the repositories in a github-repository (which, unmodified works fine). 
  I'm attempting to modify it to return only the repositories with a specified primary language, i.e. 'Matlab'. I've probably royally butchered it by now.</p>
  
  <pre><code> $(function () {
   var lang = 'Matlab';
   var lang2 = '#' + lang;
   $('#' + lang).html('Loading...');
  
   var username = 'lallers';
   var requri = 'https://api.github.com/users/' + username;
   var repouri = 'https://api.github.com/users/' + username + '/repos';
   requestJSON(requri, function (json) {
       var fullname = json.name;
       var username = json.login;
       var aviurl = json.avatar_url;
       var profileurl = json.html_url;
       var location = json.location;
       var followersnum = json.followers;
       var followingnum = json.following;
       var reposnum = json.public_repos;
       var email = json.email;
       if (fullname == undefined) {
           fullname = username;
       }
       var outhtml = '&lt;div class="repolist clearfix"&gt;&lt;ul&gt;';
  
       var repositories;
       $.getJSON(repouri, function (json) {
           repositories = json;
           outputPageContent();
       });
  
       function outputPageContent() {
           if (repositories.length == 0) {
               outhtml = outhtml + '&lt;p&gt;No repos!&lt;/p&gt;&lt;/div&gt;';
           } else {
               $.each(repositories, function (index) {
                   if (repositories[index].language == lang) {
                       outhtml = outhtml + '&lt;li&gt;&lt;a href="' + repositories[index].html_url + '" target="_blank"&gt;' + repositories[index].name + '&lt;/a&gt;&lt;/li&gt;';
                   } else {
                       return true;
                   }
               }); // end each statement
               outhtml = outhtml + '&lt;/ul&gt;&lt;/div&gt;';
           } // end else statement
           $('#' + lang).html(outhtml);
       } // end else statement
  
   }); // end requestJSON Ajax call
  
   function requestJSON(url, callback) {
       $.ajax({
           url: url,
           complete: function (xhr) {
               callback.call(null, xhr.responseJSON);
           }
       });
   }
  });
  </code></pre>