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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.