var imported = document.createElement("script"); imported.src = 'http://widgets.pxsol.com/widget.php?pos=Kahuak&lng=es&type=activity'; document.head.appendChild(imported);