The reason your code is not working is because you have a “Mixed Content” error showing in the console (Ctrl+Shft+I in Chrome). Codepen serves its pages over https, but since you were making an AJAX call to a url starting with http:, Chrome (and most browsers) do not allow this for security purposes. You can correct this problem by changing the http: to https in your code.