Commit 51191224 authored by Fabian van den Broek's avatar Fabian van den Broek

bank select lijstje

parent 7a8fd9e2
$(function() {
var server = "http://localhost:8080/irma_idin_server/api/v1/idin";
function getBanks (){
$.ajax({
type: "GET",
contentType: "application/json;charset=utf-8",
url: server + "/banks",
success: populateBankSelect,
error: error,
});
}
function populateBankSelect(data) {
$.each(data, function(countryName, issuers) {
var optgroup = $('<optgroup>').attr('label', countryName);
$.each(issuers, function(i, issuer) {
optgroup.append($('<option>').text(issuer["issuerName"]).attr('value', issuer["issuerID"]));
});
$('#bank-select').append(optgroup);
});
}
function error(jqXHR, status, error) {
console.log(jqXHR, status, error);
}
getBanks()
});
<!DOCTYPE html>
<html lang="nl">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="../../favicon.ico">
<title> Basis attributen laden met iDIN </title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script type="text/javascript" src="iDIN.js"></script>
</head>
<body>
<select id="bank-select">
<option>Choose a bank</option>
</select>
</body>
</html>
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment