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

That is fine. A closure looks like this:

var value;
function doSomething(){
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)