{"action":"created","comment":{"url":"https://api.github.com/repos/jaypinho/linkfixer/pulls/comments/44232118","id":44232118,"diff_hunk":"@@ -48,25 +48,26 @@ function readCSVFile() {\n \n     var lines = reader.result.split('\\n');\n \n-    for(var i = 0; i < lines.length; i+=1) {\n+    lines.forEach(function(line) {\n \n       var new_row = document.createElement('tr');\n-      var new_cell = document.createElement('td'); new_cell.appendChild(document.createTextNode(lines[i]));\n+      var new_cell = document.createElement('td'); new_cell.appendChild(document.createTextNode(line));\n       new_row.appendChild(new_cell);\n \n       var xhttp = new XMLHttpRequest();\n-      xhttp.open(\"GET\", \"http://linkfixer.herokuapp.com/ping_url?url_string=\" + encodeURIComponent(lines[i]) + \"&search_term=\" + encodeURIComponent(document.getElementById('search_term').value), false);\n+      xhttp.open(\"GET\", \"ping_url?url_string=\" + encodeURIComponent(line) + \"&search_term=\" + encodeURIComponent(document.getElementById('search_term').value));\n+      xhttp.onreadystatechange = function() {","path":"app/views/linkers/index.html.erb","position":15,"original_position":15,"commit_id":"c55ecc7371d1100df89b2db3894f19d3d5708e14","original_commit_id":"c55ecc7371d1100df89b2db3894f19d3d5708e14","user":{"login":"jessepinho","id":1121544,"avatar_url":"https://avatars.githubusercontent.com/u/1121544?v=3","gravatar_id":"","url":"https://api.github.com/users/jessepinho","html_url":"https://github.com/jessepinho","followers_url":"https://api.github.com/users/jessepinho/followers","following_url":"https://api.github.com/users/jessepinho/following{/other_user}","gists_url":"https://api.github.com/users/jessepinho/gists{/gist_id}","starred_url":"https://api.github.com/users/jessepinho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jessepinho/subscriptions","organizations_url":"https://api.github.com/users/jessepinho/orgs","repos_url":"https://api.github.com/users/jessepinho/repos","events_url":"https://api.github.com/users/jessepinho/events{/privacy}","received_events_url":"https://api.github.com/users/jessepinho/received_events","type":"User","site_admin":false},"body":"Since we're no longer synchronous, you can't simply call `xhttp.send()` and then check its `readyState` and `status` before appending the new rows. Instead, you have to give it an `onreadystatechange` callback for it to call once the request has successfully completed (since it's now asynchronous).","created_at":"2015-11-08T22:47:40Z","updated_at":"2015-11-08T22:47:40Z","html_url":"https://github.com/jaypinho/linkfixer/pull/3#discussion_r44232118","pull_request_url":"https://api.github.com/repos/jaypinho/linkfixer/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/jaypinho/linkfixer/pulls/comments/44232118"},"html":{"href":"https://github.com/jaypinho/linkfixer/pull/3#discussion_r44232118"},"pull_request":{"href":"https://api.github.com/repos/jaypinho/linkfixer/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/jaypinho/linkfixer/pulls/3","id":50072782,"html_url":"https://github.com/jaypinho/linkfixer/pull/3","diff_url":"https://github.com/jaypinho/linkfixer/pull/3.diff","patch_url":"https://github.com/jaypinho/linkfixer/pull/3.patch","issue_url":"https://api.github.com/repos/jaypinho/linkfixer/issues/3","number":3,"state":"open","locked":false,"title":"Smallest possible change to get async Ajax working","user":{"login":"jessepinho","id":1121544,"avatar_url":"https://avatars.githubusercontent.com/u/1121544?v=3","gravatar_id":"","url":"https://api.github.com/users/jessepinho","html_url":"https://github.com/jessepinho","followers_url":"https://api.github.com/users/jessepinho/followers","following_url":"https://api.github.com/users/jessepinho/following{/other_user}","gists_url":"https://api.github.com/users/jessepinho/gists{/gist_id}","starred_url":"https://api.github.com/users/jessepinho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jessepinho/subscriptions","organizations_url":"https://api.github.com/users/jessepinho/orgs","repos_url":"https://api.github.com/users/jessepinho/repos","events_url":"https://api.github.com/users/jessepinho/events{/privacy}","received_events_url":"https://api.github.com/users/jessepinho/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-11-08T22:46:18Z","updated_at":"2015-11-08T22:47:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9eb62266fb0da0de1b868882f7defee8c1b49d3f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jaypinho/linkfixer/pulls/3/commits","review_comments_url":"https://api.github.com/repos/jaypinho/linkfixer/pulls/3/comments","review_comment_url":"https://api.github.com/repos/jaypinho/linkfixer/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jaypinho/linkfixer/issues/3/comments","statuses_url":"https://api.github.com/repos/jaypinho/linkfixer/statuses/c55ecc7371d1100df89b2db3894f19d3d5708e14","head":{"label":"jessepinho:smallest-possible-change-for-ajax-fix","ref":"smallest-possible-change-for-ajax-fix","sha":"c55ecc7371d1100df89b2db3894f19d3d5708e14","user":{"login":"jessepinho","id":1121544,"avatar_url":"https://avatars.githubusercontent.com/u/1121544?v=3","gravatar_id":"","url":"https://api.github.com/users/jessepinho","html_url":"https://github.com/jessepinho","followers_url":"https://api.github.com/users/jessepinho/followers","following_url":"https://api.github.com/users/jessepinho/following{/other_user}","gists_url":"https://api.github.com/users/jessepinho/gists{/gist_id}","starred_url":"https://api.github.com/users/jessepinho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jessepinho/subscriptions","organizations_url":"https://api.github.com/users/jessepinho/orgs","repos_url":"https://api.github.com/users/jessepinho/repos","events_url":"https://api.github.com/users/jessepinho/events{/privacy}","received_events_url":"https://api.github.com/users/jessepinho/received_events","type":"User","site_admin":false},"repo":{"id":45793449,"name":"linkfixer","full_name":"jessepinho/linkfixer","owner":{"login":"jessepinho","id":1121544,"avatar_url":"https://avatars.githubusercontent.com/u/1121544?v=3","gravatar_id":"","url":"https://api.github.com/users/jessepinho","html_url":"https://github.com/jessepinho","followers_url":"https://api.github.com/users/jessepinho/followers","following_url":"https://api.github.com/users/jessepinho/following{/other_user}","gists_url":"https://api.github.com/users/jessepinho/gists{/gist_id}","starred_url":"https://api.github.com/users/jessepinho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jessepinho/subscriptions","organizations_url":"https://api.github.com/users/jessepinho/orgs","repos_url":"https://api.github.com/users/jessepinho/repos","events_url":"https://api.github.com/users/jessepinho/events{/privacy}","received_events_url":"https://api.github.com/users/jessepinho/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jessepinho/linkfixer","description":"","fork":true,"url":"https://api.github.com/repos/jessepinho/linkfixer","forks_url":"https://api.github.com/repos/jessepinho/linkfixer/forks","keys_url":"https://api.github.com/repos/jessepinho/linkfixer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jessepinho/linkfixer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jessepinho/linkfixer/teams","hooks_url":"https://api.github.com/repos/jessepinho/linkfixer/hooks","issue_events_url":"https://api.github.com/repos/jessepinho/linkfixer/issues/events{/number}","events_url":"https://api.github.com/repos/jessepinho/linkfixer/events","assignees_url":"https://api.github.com/repos/jessepinho/linkfixer/assignees{/user}","branches_url":"https://api.github.com/repos/jessepinho/linkfixer/branches{/branch}","tags_url":"https://api.github.com/repos/jessepinho/linkfixer/tags","blobs_url":"https://api.github.com/repos/jessepinho/linkfixer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jessepinho/linkfixer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jessepinho/linkfixer/git/refs{/sha}","trees_url":"https://api.github.com/repos/jessepinho/linkfixer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jessepinho/linkfixer/statuses/{sha}","languages_url":"https://api.github.com/repos/jessepinho/linkfixer/languages","stargazers_url":"https://api.github.com/repos/jessepinho/linkfixer/stargazers","contributors_url":"https://api.github.com/repos/jessepinho/linkfixer/contributors","subscribers_url":"https://api.github.com/repos/jessepinho/linkfixer/subscribers","subscription_url":"https://api.github.com/repos/jessepinho/linkfixer/subscription","commits_url":"https://api.github.com/repos/jessepinho/linkfixer/commits{/sha}","git_commits_url":"https://api.github.com/repos/jessepinho/linkfixer/git/commits{/sha}","comments_url":"https://api.github.com/repos/jessepinho/linkfixer/comments{/number}","issue_comment_url":"https://api.github.com/repos/jessepinho/linkfixer/issues/comments{/number}","contents_url":"https://api.github.com/repos/jessepinho/linkfixer/contents/{+path}","compare_url":"https://api.github.com/repos/jessepinho/linkfixer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jessepinho/linkfixer/merges","archive_url":"https://api.github.com/repos/jessepinho/linkfixer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jessepinho/linkfixer/downloads","issues_url":"https://api.github.com/repos/jessepinho/linkfixer/issues{/number}","pulls_url":"https://api.github.com/repos/jessepinho/linkfixer/pulls{/number}","milestones_url":"https://api.github.com/repos/jessepinho/linkfixer/milestones{/number}","notifications_url":"https://api.github.com/repos/jessepinho/linkfixer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jessepinho/linkfixer/labels{/name}","releases_url":"https://api.github.com/repos/jessepinho/linkfixer/releases{/id}","created_at":"2015-11-08T18:39:42Z","updated_at":"2015-11-08T18:39:43Z","pushed_at":"2015-11-08T22:46:03Z","git_url":"git://github.com/jessepinho/linkfixer.git","ssh_url":"git@github.com:jessepinho/linkfixer.git","clone_url":"https://github.com/jessepinho/linkfixer.git","svn_url":"https://github.com/jessepinho/linkfixer","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"jaypinho:master","ref":"master","sha":"d6e209823e00be09dd1ba76f10652b226de9e59e","user":{"login":"jaypinho","id":3118454,"avatar_url":"https://avatars.githubusercontent.com/u/3118454?v=3","gravatar_id":"","url":"https://api.github.com/users/jaypinho","html_url":"https://github.com/jaypinho","followers_url":"https://api.github.com/users/jaypinho/followers","following_url":"https://api.github.com/users/jaypinho/following{/other_user}","gists_url":"https://api.github.com/users/jaypinho/gists{/gist_id}","starred_url":"https://api.github.com/users/jaypinho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaypinho/subscriptions","organizations_url":"https://api.github.com/users/jaypinho/orgs","repos_url":"https://api.github.com/users/jaypinho/repos","events_url":"https://api.github.com/users/jaypinho/events{/privacy}","received_events_url":"https://api.github.com/users/jaypinho/received_events","type":"User","site_admin":false},"repo":{"id":45634193,"name":"linkfixer","full_name":"jaypinho/linkfixer","owner":{"login":"jaypinho","id":3118454,"avatar_url":"https://avatars.githubusercontent.com/u/3118454?v=3","gravatar_id":"","url":"https://api.github.com/users/jaypinho","html_url":"https://github.com/jaypinho","followers_url":"https://api.github.com/users/jaypinho/followers","following_url":"https://api.github.com/users/jaypinho/following{/other_user}","gists_url":"https://api.github.com/users/jaypinho/gists{/gist_id}","starred_url":"https://api.github.com/users/jaypinho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaypinho/subscriptions","organizations_url":"https://api.github.com/users/jaypinho/orgs","repos_url":"https://api.github.com/users/jaypinho/repos","events_url":"https://api.github.com/users/jaypinho/events{/privacy}","received_events_url":"https://api.github.com/users/jaypinho/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jaypinho/linkfixer","description":"","fork":false,"url":"https://api.github.com/repos/jaypinho/linkfixer","forks_url":"https://api.github.com/repos/jaypinho/linkfixer/forks","keys_url":"https://api.github.com/repos/jaypinho/linkfixer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jaypinho/linkfixer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jaypinho/linkfixer/teams","hooks_url":"https://api.github.com/repos/jaypinho/linkfixer/hooks","issue_events_url":"https://api.github.com/repos/jaypinho/linkfixer/issues/events{/number}","events_url":"https://api.github.com/repos/jaypinho/linkfixer/events","assignees_url":"https://api.github.com/repos/jaypinho/linkfixer/assignees{/user}","branches_url":"https://api.github.com/repos/jaypinho/linkfixer/branches{/branch}","tags_url":"https://api.github.com/repos/jaypinho/linkfixer/tags","blobs_url":"https://api.github.com/repos/jaypinho/linkfixer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jaypinho/linkfixer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jaypinho/linkfixer/git/refs{/sha}","trees_url":"https://api.github.com/repos/jaypinho/linkfixer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jaypinho/linkfixer/statuses/{sha}","languages_url":"https://api.github.com/repos/jaypinho/linkfixer/languages","stargazers_url":"https://api.github.com/repos/jaypinho/linkfixer/stargazers","contributors_url":"https://api.github.com/repos/jaypinho/linkfixer/contributors","subscribers_url":"https://api.github.com/repos/jaypinho/linkfixer/subscribers","subscription_url":"https://api.github.com/repos/jaypinho/linkfixer/subscription","commits_url":"https://api.github.com/repos/jaypinho/linkfixer/commits{/sha}","git_commits_url":"https://api.github.com/repos/jaypinho/linkfixer/git/commits{/sha}","comments_url":"https://api.github.com/repos/jaypinho/linkfixer/comments{/number}","issue_comment_url":"https://api.github.com/repos/jaypinho/linkfixer/issues/comments{/number}","contents_url":"https://api.github.com/repos/jaypinho/linkfixer/contents/{+path}","compare_url":"https://api.github.com/repos/jaypinho/linkfixer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jaypinho/linkfixer/merges","archive_url":"https://api.github.com/repos/jaypinho/linkfixer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jaypinho/linkfixer/downloads","issues_url":"https://api.github.com/repos/jaypinho/linkfixer/issues{/number}","pulls_url":"https://api.github.com/repos/jaypinho/linkfixer/pulls{/number}","milestones_url":"https://api.github.com/repos/jaypinho/linkfixer/milestones{/number}","notifications_url":"https://api.github.com/repos/jaypinho/linkfixer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jaypinho/linkfixer/labels{/name}","releases_url":"https://api.github.com/repos/jaypinho/linkfixer/releases{/id}","created_at":"2015-11-05T19:27:44Z","updated_at":"2015-11-05T19:30:01Z","pushed_at":"2015-11-08T22:46:18Z","git_url":"git://github.com/jaypinho/linkfixer.git","ssh_url":"git@github.com:jaypinho/linkfixer.git","clone_url":"https://github.com/jaypinho/linkfixer.git","svn_url":"https://github.com/jaypinho/linkfixer","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":3,"forks":1,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jaypinho/linkfixer/pulls/3"},"html":{"href":"https://github.com/jaypinho/linkfixer/pull/3"},"issue":{"href":"https://api.github.com/repos/jaypinho/linkfixer/issues/3"},"comments":{"href":"https://api.github.com/repos/jaypinho/linkfixer/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/jaypinho/linkfixer/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/jaypinho/linkfixer/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jaypinho/linkfixer/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/jaypinho/linkfixer/statuses/c55ecc7371d1100df89b2db3894f19d3d5708e14"}}}}