A Pen by Jay Looney on CodePen.
Created
September 24, 2017 10:10
-
-
Save zenware/67bf43ee0b27452ca6389fb414959c50 to your computer and use it in GitHub Desktop.
gGLWER
This file contains 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 characters
<select id="insurance-provider"></select> |
This file contains 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 characters
var url = "https://api.betterdoctor.com/2016-03-01/insurances?user_key=188abcacef63ce01200709dd0a48ffe3"; | |
$.getJSON(url, function (response) { | |
populateSelect(response['data']); | |
}); | |
var select = document.getElementById('insurance-provider'); | |
function populateSelect(insurance_data) { | |
for (var i = 0; i<=insurance_data.length; i++){ | |
var opt = document.createElement('option'); | |
opt.value = insurance_data[i]['name']; | |
opt.innerHTML = insurance_data[i]['name']; | |
select.appendChild(opt); | |
} | |
} |
This file contains 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 characters
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment