File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes JS function with 'defer'... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "JS function with Watch "JS function with New topic

JS function with 'defer'...

ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
What exactly the 'defer' is?

I have heard two things about it:

1. The JS function with 'defer' is called at the end, after completion of the whole document (page).

2. Browser doesn't wait for completion of JS function with 'defer'. It continues the execution of rest of the things. Not clear, how it happens? (threading???)

Please clear my doubt.

Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
Not sure why anyone would use it, but scroll to the bottom of this ro read the whole thing:

I agree. Here's the link:
subject: JS function with 'defer'...
It's not a secret anymore!