This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
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


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "JS function with Watch "JS function with New topic
Author

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.

Thanks.
Eric Pascarello
author
Rancher

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

http://www.quirksmode.org/js/placejs.html

Eric
 
wood burning stoves
 
subject: JS function with 'defer'...