View Single Post
  #2 (permalink)  
Old December 3rd, 2009, 11:59 PM
nzakas's Avatar
nzakas nzakas is offline
Wrox Author
 
Join Date: Dec 2004
Location: Peabody, MA, USA.
Posts: 217
Thanks: 0
Thanked 5 Times in 5 Posts
Default

That is fine. A closure looks like this:

Code:
var value;
function doSomething(){
    alert(value)
}
It doesn't have anything to do with parameter passing. Your onreadystatechange handler is a closure because it uses receiveReq, which is defined outside of it.

Your code should be fine. :)
__________________
Nicholas C. Zakas
Author, Professional JavaScript for Web Developers (ISBN 0764579088)
http://www.nczonline.net/
Reply With Quote