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
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
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
3 matches
Mail list logo