function getClient(){ var curentHost = window.location.protocol + '//' + window.location.host; var clientURL = curentHost + '/download.html?n=' + Math.random(); if(clientURL){ $('#elevator-app-url0').val(clientURL); getQrcode('elevator-app-qrcode0','elevator-app-url0'); function getQrcode(ele1,ele2){ var qrcode = new QRCode(document.getElementById(ele1), { width: 108, height: 108 }); var elText = document.getElementById(ele2); qrcode.makeCode(elText.value); } } }