function getFlag() {
  document.getElementById('flag').innerHTML = '';
  document.getElementById('download').href = '';
  var request = new XMLHttpRequest();
  request.onreadystatechange = function() {
    if (request.readyState == 4 && request.status == 200) {
      document.getElementById('flag').innerHTML = request.responseText;
      document.getElementById('download').href = 'data:image/svg+xml,' + encodeURIComponent(request.responseText)
    }
  };
  request.open('GET', '/FlagGenerator/RawFlag', true);
  request.send();
}
