I want to add DOM element to head section of HTML. jQuery does not allow adding DOM element script to the head section and they execute instead, Reference.
I want t
var script = $('') document.getElementsByTagName("head")[0].appendChild(script[0])
But in that case script will not be executed and functions will be not accessible in global namespase. To use code in you need do as in you question
$('head').append(script);