Jump to content

jQuery Possible Syntax or Format Issue


mongoose0031800

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/244875-jquery-possible-syntax-or-format-issue/
Share on other sites

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();
      }); 
    }
  }); 
}); 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.