I got output like below, how to append whole into the head tag using JavaScript?
<meta name="generator" content="Joomla! - Open Source Content Management" />
<title></title>
<link rel="stylesheet" href="templates/css/template.css" />
<link rel="stylesheet" href="templates/css/templatee.css" />
<style type="text/css">
<![CDATA[
BODY {background: #00ff00;color: rgb(0,0,255);}
]]>
</style>
metatags after the head has been parsed is not useful, they are simply ignored.headis guaranteed to be loaded and parsed beforebody, forkingheadafterwards breaks the default behavior. So, basicly you shouldn't do this. If you need dynamichead, create it on server-side. Rather this sounds like an XY-problem, what is the actual purpose of re-building thehead?