INNER CODE UNIT · JavaScript

init

dockersamples/example-voting-app · result/views/app.js:30

  var init = function(){
    document.body.style.opacity=1;
    updateScores();
  };
  socket.on('message',function(data){
    init();
  });
});

function getPercentages(a, b) {
  var result = {};

  if (a + b > 0) {
    result.a = Math.round(a / (a + b) * 100);
    result.b = 100 - result.a;
  } else {
    result.a = result.b = 50;
  }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…