Last active
April 6, 2017 19:53
-
-
Save alexruzenhack/985adb07dd575b402adf6f926b687526 to your computer and use it in GitHub Desktop.
How to insert a hardcode javascript in body tag of the HTML DOM
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
(function () { | |
var ss = document.createElement('script'); | |
ss.type = 'text/javascript'; | |
ss.async = true; | |
ss.src = '//app.shoptarget.com.br/js/tracking.js'; | |
var body = document.getElementsByTagName('body')[0]; // seleciona o elemento body | |
body.appendChild(ss); // adiciona elemento script antes do fechamento do elemento body | |
})(); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment