On Thu, Apr 14, 2011 at 10:01 AM, Poetro <poe...@gmail.com> wrote:

> It just behaves totally differently from the embedded <script> tag.
> Adding it this way will load the file in an somewhat asynchronous way.
> And you also cannot have document.write statements in the JS files
> loaded this way, as the document may be closed by the time the script
> loads. It can be more efficient then loading it via JavaScript, as it
> doesn't block the rendering of the page, but it has a different
> meaning.
>

However, as far as speed and efficiency goes, there is no noticable
difference. (Not taking asynchronous execution into account.)

The topic of your email is slightly confusing as it has little or nothing to
do with function calls. Unless you intend to call that function a million
times per second, which I would strongly urge you not to in any case :p

(In terms of function calls themselves, they are _relatively_ very
expensive. If you have high performing code you need to limit the number of
functions calls as much as possible. In most scripts you should really not
worry about this though. I'm talking parsing or image processing with a
million+ calls to a function where this becomes noticable. Always profile
your code before trying to optimize stuff like this.)

- peter

-- 
To view archived discussions from the original JSMentors Mailman list: 
http://www.mail-archive.com/jsmentors@jsmentors.com/

To search via a non-Google archive, visit here: 
http://www.mail-archive.com/jsmentors@googlegroups.com/

To unsubscribe from this group, send email to
jsmentors+unsubscr...@googlegroups.com

Reply via email to