Search Results

Search found 5 results on 1 pages for 'wurlitzer'.

Page 1/1 | 1 

  • Reordering arrays

    - by Wurlitzer
    Hi, Say, I have an array that looks like this: var playlist = [ {artist:"Herbie Hancock", title:"Thrust"}, {artist:"Lalo Schifrin", title:"Shifting Gears"}, {artist:"Faze-O", title:"Riding High"} ]; How can move an element to another position? I want to move for example, {artist:"Lalo Schifrin", title:"Shifting Gears"} to the end. I tried using splice, like this: var tmp = playlist.splice(2,1); playlist.splice(2,0,tmp); But it doesn't work. Any help would be appreciated.

    Read the article

  • Dynamic content doesn't work when loaded with ajax

    - by Wurlitzer
    I'm trying to load some dynamic content after the user has logged in, using $.ajax, like so: $.ajax({ url: "functions.php", type: "GET", data: login_info, datatype: 'html', async: false, success: function (response) { $('#main').html(response); } }); The problem is, that some events don't work, when loaded this way. I fixed the buttons with the .live() method, but a sortable list for example, doesn't work. How can I somehow refresh the DOM, and let jquery know of these new added elements? Thanks!

    Read the article

  • Getting the position of the element in a list when it's drag/dropped (ui.sortable)

    - by Wurlitzer
    Hi, I have a sortable list like this one: http://jqueryui.com/demos/sortable Is it possible to get the start and end position of the element in the list, when it has been moved? I'm talking about their position number, in the list. For example, if I move element 2 to position 5 in the list, I'd like to assign those two numbers to variables. I'm new to jQuery - any help would be much appreciated.

    Read the article

  • Getting an array back from php using $.ajax

    - by Wurlitzer
    A php script is giving this array (which has been passed through json_encode()) [{name:"a1",path:"b1"},{name:"a2",path:"b2"}] I use the following function to retrieve the array to jquery: $.ajax({ type: "POST", url: "functions.php", data: "action=" + something, cache: false, success: function(response) { alert(response); } }); The problem is I get the array back as a string: (new String("[{name:"a1",path:"b1"},{name:"a2",path:"b2"}}]")) How can I get it to be a javascript array? Help would be much appreciated.

    Read the article

  • Wait for function to finish before executing the rest

    - by Wurlitzer
    When the user refreshes the page, defaultView() is called, which loads some UI elements. $.address.change() should execute when defaultView() has finished, but this doesn't happen all the time. $.address.change() cannot be in the success: callback, as it's used by the application to track URL changes. defaultView(); function defaultView() { $('#tout').fadeOut('normal', function() { $.ajax({ url: "functions.php", type: "GET", data: "defaultview=true", async: false, success: function (response) { $('#tout').html(response).fadeIn('normal'); } }); }); } $.address.change(function(hash) { hash = hash.value; getPage(hash); }); I'm at a loss as to how to make $.address.change() wait for defaultView() to finish. Any help would be appreciated.

    Read the article

1