1 Replies - 355 Views - Last Post: 15 August 2011 - 05:36 PM

#1 mongoose0031800   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 15-August 11

jQuery Possible Syntax or Format Issue

Posted 15 August 2011 - 05:03 PM

Hello,

I'm trying to add a line to my jQuery function that would make the page refresh after the AJAX was finished. This is my original script below that works fine.

$(document).ready(function() { 
  $("#show_list").sortable({ 
    handle : '.handle',
    update : function () { 
      var order = $('#show_list').sortable('serialize'); 
      $("#info").load("scripts/process_show_order.php?"+order); 
    }
  }); 
}); 



And this is my modified script that doesn't work.

$(document).ready(function() { 
  $("#show_list").sortable({ 
    handle : '.handle',
    update : function () { 
      var order = $('#show_list').sortable('serialize'); 
      $("#info").load("scripts/process_show_order.php?"+order); 
    },
    location.reload();
  }); 
}); 



I added the , after the function ended } and then on the next line I added location.reload();...which broke the script. Am I doing something wrong?

Mongoose

Is This A Good Question/Topic? 0
  • +

Replies To: jQuery Possible Syntax or Format Issue

#2 mongoose0031800   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 15-August 11

Re: jQuery Possible Syntax or Format Issue

Posted 15 August 2011 - 05:36 PM

Ok problem solved. But here's the code that fixed it in case anyone else has the same issue.

$(document).ready(function() { 
  $("#show_list").sortable({ 
    handle : '.handle',
    update : function () { 
      var order = $('#show_list').sortable('serialize'); 
      $("#info").load("scripts/process_show_order.php?"+order,function(){
            location.reload();
      }); 
    }
  }); 
}); 


Was This Post Helpful? 0
  • +
  • -

Page 1 of 1