Created
          January 29, 2015 19:11 
        
      - 
      
- 
        Save bdfinlayson/1916c1b3f5bcdfad95f8 to your computer and use it in GitHub Desktop. 
Revisions
- 
        bdfinlayson created this gist Jan 29, 2015 .There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,31 @@ 'use strict'; var userZipCode, startingUrl, customUrl; document.querySelector('#submitButton').addEventListener('click', function() { userZipCode = document.querySelector('#userZipCode').value; startingUrl = 'https://api.wunderground.com/api/152eccaad753eb4b/forecast10day/q/37207.json'; customUrl = startingUrl.replace('37207', userZipCode); console.log("The user's zip code is: " + userZipCode); console.log("The starting url was: " + startingUrl); console.log("The weather json file link should be: " + customUrl); }); function getJSON(customUrl, cb){ var request = new XMLHttpRequest(); request.open('GET', customUrl); request.onload = function () { if (this.status >= 200 && this.status < 400) { cb(JSON.parse(this.response)); } } request.send(); }