Is it possible to populate a select drop-down menu from an external api?
Hello guys.
I am wondering if it is possible to populate a select drop-down menu in a blade template using an external api.
I googled this question and all the answers are examples that use a database for the select drop-down menu filling with data.
Thank you!
Or any other classname. Or an ID. Check the link I posted. You are just using the class/id to tell jquery which element to activate select2 on. Have you used jquery before?
<script>
// Put your script here (that is only necessary for this page)!
$('formControlSelectShortCode').select2({
ajax: {
url: 'https://api.github.com/search/repositories',
dataType: 'json'
// Additional AJAX parameters go here; see the end of this chapter for the full code of this example
}
});
</script>