Search Results

Search found 2 results on 1 pages for 'heilemann'.

Page 1/1 | 1 

  • AJAX call in for loop won't return values to correct array positions

    - by Heilemann
    I need to get a range of pages using AJAX and put them into an array, where their given place in the array is equal to the i of a for loop (it's a caching-like function for blog pages, and the range of the for loop is entirely variable). I'm doing something akin to the following: var bongo = new Array(); for (i = 0; i < 10; i++) { jQuery.ajax({ type: "GET", url: http://localhost, data: queryString, success: function(request) { bongo[i] = request } }) } The problem is, that unless I add async: false to the .ajax options (which would make it... SJAX?), which causes the requests to basically pause the browser, going against what I'm trying to do, the i in the success callback will always end up being 11, whereas I of course want it to pour the returned data into each slot of the array from 0 to 10. I've tried replacing the line with this: bongo[i] = jQuery.ajax({ type: "GET", url: http://localhost, data: queryString }).responseText But that made no difference.

    Read the article

  • Animated transitions for jQuery UI's sortable

    - by Heilemann
    Just out of curiosity, as I haven't been able to find anything anywhere; does anyone know of a way to get jQuery UI's sortable function to animate its sorting? What I mean is, when you move an element around the sortable parent, its children, the sortables, skip around instead of smoothly animating to their new position, which besides from being an eyesore can also make it a bit difficult to figure out what has moved where. There's obviously no default option for this, but I was hoping that perhaps someone, somewhere, had a neat solution.

    Read the article

1