Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7927051
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T19:06:57+00:00 2026-06-03T19:06:57+00:00

So I know that $(‘#table_content’).sortable(‘serialize’) returns an array because I tested it with console.info.

  • 0

So I know that $('#table_content').sortable('serialize') returns an array because I tested it with console.info. What I want to do is use the value of that expression as data in a post request but I want it’s result to be passed as data in a callback to another ajax request. I thought I could do this by just placing $('#table_content').sortable('serialize') as the data argument for .post but when I do this, the parameter is “undefined=undefined” according to firebug.

jQuery ->
  ids = $('#table_content').sortable('serialize')
  console.info(ids)

  $('#tasks_table').load('/dashboard #tasks_table', null, -> $.post('/tasks/sort', $('#table_content').sortable('serialize'), ->location.reload()))

undefined=undefined

Any ideas on why this is happening? Note, that if I pass ids in the place of $('#table_content').sortable('serialize'), it works but I only want to the value of the $('#table_content').sortable('serialize') once the previous ajax request has run. If I just use ids, then it’s value does not reflect the change after calling $('#tasks_table').load

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T19:06:59+00:00Added an answer on June 3, 2026 at 7:06 pm

    From you example, it seems you end-up with the following structure after loading (maybe not a DIV element of course):

    <!-- #tasks_table you call .load() upon -->
    <div id="tasks_table"> 
       <!-- #tasks_table that is loaded -->
       <div id="tasks_table">
       </div>
    </div>
    

    Be aware that loading page fragments will insert the loaded fragment (including the wrapping element) into the matched set elements, not replace them !

    You should probably extract the children of the #tasks_table in the load:

    $('#tasks_table').load('/dashboard #tasks_table > *', ... );
    

    Not sure about this one but you’ll maybe have to initialize the sortable plugin before calling the ‘serialize’ method on the loaded content.

    $('#tasks_table').load('/dashboard #tasks_table', null, function() {
        var ids = $('#table_content')
            .sortable() // init first
            .sortable('serialize'); // then call 'serialize'
        $.post('/tasks/sort', ids, function() {
            location.reload()
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know that Job.all returns an array of all jobs. But, what would be
We know that behind the scenes, the ASP.NET MVC framework will use reflection to
I know that I can use virtual keyword to tell the entity framework that
I know that you can set the number of threads to use for all
i know that you can use themeroller to customize your UI theme but is
I know that I can use implicit conversions with a class as follows but
I know that I can use ProxyPass to serve up my yardoc server instance
I know that I can use git commit --amend --file=path-to-my-new-message but this will amend
I know that the scala swing libraries are present in scala 2.8: [info] Building
I know that in general, we want to check for the presence of specific

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.