[jQuery] Re: Why does my closure not seem to share scope?

2008-07-25 Thread Kalvin
+ "") >     .click(function() { var saved = i; pageClicked(saved); > console.log("i:" + saved); })); > > } > > Closures are tricky constructions till you get used to them. > > Karl Rudd > > On Fri, Jul 25, 2008 at 12:00 PM, Kalvin <[EMAIL PRO

[jQuery] Re: Why does my closure not seem to share scope?

2008-07-25 Thread Kalvin
I just tried this and Henry's right... assigning it within the closure doesn't make any difference. Does anyone know of an efficient approach to accomplishing what I'm trying to do, assigning a different click handler per page number? Perhaps I could access the text inside the local span (1, 2,