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

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -