Last active
April 6, 2017 19:54
-
-
Save alexruzenhack/a993a8e34f2ae52b8093903433f5fa24 to your computer and use it in GitHub Desktop.
How to insert a hardcode javascript in head 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/javascipt"> | |
try{ | |
(function(window,document){ | |
head=document.getElementsByTagName('head')[0]; | |
script=document.createElement('script'); | |
// treat the hardcode script tag | |
head.appendChild(script); | |
})(window,document); | |
} catch(e) { | |
console.log('[GTM][Error in tag "nomeDaTag"]: '+e); | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment