javascript - How do I create an element after the closing body tag -
i checking if jquery included in document. if not want create element after closing body tag.
<script type="text/javascript"> if( !(typeof jquery === 'function') ){ var script = document.createelement('script'); script.src = 'https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js'; script.type = 'text/javascript'; var head = document.getelementsbytagname("head")[0]; head.appendchild(script); } </script>
if body tag appends top. wanna either append end of body tag or right after closing it.
please help.
use document.body.appendchild()
. append element @ end of body tag.
by way, jandy right, there little need add javascript file dynamically @ end of body.
Comments
Post a Comment