Hi all, short time lurker and first time poster.

I just started writing a new tools library, and one of the methods is
some syntactic sugar that allows you to manipulate the DOM and include
a javascript file in the head element.

[code]
function include(files) {
        var head = document.getElementsByTagName('head')[0];

        var script = document.createElement('script');
        script.src = filename;
        script.type = 'text/javascript';

        head.appendChild(script);
}
[/code]

The question that arose in my head, if I used this in a production way
then how much less inefficient is it than the usual tradition of
including the script elements in the HTML? I am a Java programmer by
history so some relation to the penalty of pushing state information
on to the stack might be useful, if possible (or appropriate!).

Thanks for reading.

-- Rob

-- 
To view archived discussions from the original JSMentors Mailman list: 
http://www.mail-archive.com/[email protected]/

To search via a non-Google archive, visit here: 
http://www.mail-archive.com/[email protected]/

To unsubscribe from this group, send email to
[email protected]

Reply via email to