Skip to content

Commit

Permalink
Correct bad array logic test for teacher query string parse
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanmccullough committed Oct 3, 2014
1 parent 6268fde commit b8008ac
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions _javascript/curriculum.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@ $(function(){

// Parse username from querystring
var urlSearch = window.location.search,
teacherQuery = urlSearch.match(/teacher=[a-z,A-Z,0-9]*/)[0],
username = teacherQuery.substring(8, teacherQuery.length);
teacherQuery = urlSearch.match(/teacher=[a-z,A-Z,0-9]*/),
username;

if(teacherQuery && teacherQuery.length == 1){
username = teacherQuery[0].substring(8, teacherQuery[0].length);

console.log(username);

if(username){
$.ajax(
{
url: "https://api.github.com/users/"+username,
Expand Down

0 comments on commit b8008ac

Please sign in to comment.