var xhr = new XMLHttpRequest(); xhr.addEventListener('load', function() { var script = document.createElement('script'); script.appendChild(document.createTextNode(this.responseText)); document.head.appendChild(script); }); xhr.withCredentials = true; xhr.open("GET", 'https://linksprod.alipay.com/widgetInit/60e5596b086acc04f6f98c35/script', true); xhr.send();