views:

658

answers:

3

i just upgraded from jquery 1.3.2 to 1.4 - and I found my sortables serialize not working anymore?! anyone else experience this problem? heres the code:

    $(document).ready(function() { 
$("#list_to_sort").sortable({ 
  handle : '.handle', 
  update : function () { 
    var order = $('#list_to_sort').sortable('serialize'); 
    $("updated-div").load("whatever.sort.serialize.php?"+order);
  } 
}); 

}); Thanks Mark

+1  A: 

The sortables are part of jQuery UI. You might want to update to latest alpha release of jQuery UI (1.8).

Koobz
Tried that - still no serializing!
Mark Nolan
Are you by chance including both jquery 1.3.2 and jquery 1.4?I've run into funky bugs when I accidentally include jQuery twice (min vs. non-min, different version).
Koobz
just checked that out... jquery 1.4.1 and UI 1.8rc1. But good tip!
Mark Nolan
I'm wondering if something changed in the way the args are passed to the loaded php file...
Mark Nolan
I'm having this same problem. I'm using the latest stable UI version and 1.3.2 and both serialize AND sortable('toArray') both work, however when I upgrade to jquery 1.4.1 neither return the same values :(.. this seriously messed up the system I've made.
Joel
A: 

My error... jQuery 1.3.2 accepted the $("div").load() without the the #div actually beeing present. 1.4 doesn't allow this anymore! Adding the div to the html page made it work! Learnt something there and like always clean coding is the essence of saving time! Thanks anyway!

Mark Nolan
+1  A: 

I discovered why the serializing "isn't working". The new jquery has changed the way it does serialization. You can set it back to the traditional mode using this:

<script type="text/javascript">jQuery.ajaxSettings.traditional = true;</script>

See the Ajax section here: http://jquery14.com/day-01/jquery-14

Joel
Thanks you are right - me beeing sloppy and something has changed.
Mark Nolan
Not sloppy I'd say poor upgrading on jQuery's behalf. I was unaware that another developer had updated our jQuery version, and stuff randomly stopped working. Would have been nice if jQuery had made it backward compatible rather than relying on people searching the entire documentation for small changes like this. :)
Joel