[jQuery] Re: How to bind data to the ajax callback function?

2007-10-15 Thread arphenlin
l. > > If you really want to minimise it, and you really only have a loop of > 2, then ... > > var url='http://foo.bar/?param='; > $.each([0,1],function(i,j){ > $.get(url+j, function(html){ > alert(j); > }); > }); > > On Oct

[jQuery] Re: How to bind data to the ajax callback function?

2007-10-15 Thread arphenlin
i); > }); > } > function doit(html, tag){ > alert(tag); > } > > On Oct 13, 11:04 am, arphenlin <[EMAIL PROTECTED]> wrote: > > Below is an example to use jQuery.get() to get some html data. > > I expect that "0", "1" (or "1", &qu

[jQuery] How to bind data to the ajax callback function?

2007-10-13 Thread arphenlin
Below is an example to use jQuery.get() to get some html data. I expect that "0", "1" (or "1", "0") are displayed, however, it displayed "2", "2". How can I do? var url='http://foo.bar/?param='; for(var i=0; i<2; i++){ $.get(url+i, function(html){ doit(html, i); // bind 'i' to the cal