{"action":"closed","issue":{"url":"https://api.github.com/repos/sf-wdi-29/ajax-with-jquery/issues/2","repository_url":"https://api.github.com/repos/sf-wdi-29/ajax-with-jquery","labels_url":"https://api.github.com/repos/sf-wdi-29/ajax-with-jquery/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/sf-wdi-29/ajax-with-jquery/issues/2/comments","events_url":"https://api.github.com/repos/sf-wdi-29/ajax-with-jquery/issues/2/events","html_url":"https://github.com/sf-wdi-29/ajax-with-jquery/issues/2","id":154297745,"number":2,"title":"variable should be \"endpoint\" instead of \"spotify_endpoint\"","user":{"login":"mnorelli","id":4873069,"avatar_url":"https://avatars.githubusercontent.com/u/4873069?v=3","gravatar_id":"","url":"https://api.github.com/users/mnorelli","html_url":"https://github.com/mnorelli","followers_url":"https://api.github.com/users/mnorelli/followers","following_url":"https://api.github.com/users/mnorelli/following{/other_user}","gists_url":"https://api.github.com/users/mnorelli/gists{/gist_id}","starred_url":"https://api.github.com/users/mnorelli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mnorelli/subscriptions","organizations_url":"https://api.github.com/users/mnorelli/orgs","repos_url":"https://api.github.com/users/mnorelli/repos","events_url":"https://api.github.com/users/mnorelli/events{/privacy}","received_events_url":"https://api.github.com/users/mnorelli/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-05-11T17:23:54Z","updated_at":"2016-05-11T18:43:26Z","closed_at":"2016-05-11T18:43:26Z","body":"In the code example under the section **Ajax and Event Handlers**, there is a GET request that uses a variable that wasn't yet defined.  I think what was meant was to use the variable that was defined.\r\n\r\nAlso, the section statement should be, according to Alex, a POST, not a GET request\r\n```\r\nvar endpoint = 'https://api.spotify.com/v1/search?q=goodbye&type=artist'\r\n\r\n// click event on button\r\n$('button').on('click', function(event) {\r\n  $.get(spotify_endpoint, function(data) {   //  <--- should be \"endpoint\" not spotify_endpoint\r\n    console.log(data);\r\n  });\r\n});\r\n\r\n// submit event on form\r\n$('form').on('submit', function(event){\r\n  $.get(endpoint, function(data) {          // <--- and this should be a \"post\" request\r\n    console.log(data);\r\n  });\r\n});\r\n```"}}