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 7669813
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T15:40:48+00:00 2026-05-31T15:40:48+00:00

Im storing track IDs in a database that are used as playlists. The track

  • 0

Im storing track IDs in a database that are used as playlists.

The track ID data is retrieved using jQuery $.get() and is returned in a JSON array.

Next a jQuery $.each() loops a SC.get(‘/tracks/’) that is passed the relevant track id.

$.each(pl_array.track, function(i) {
    var pl_track_id = '/tracks/' + pl_array.track[i].id;
    SC.get(pl_track_id,function (tracks) {
        //looped code here
    });
});

The problem is the SC.get() call is asynchronous, and will result in the tracks being ordered randomly. The jQuery $.get() has the option to disable asynchronous and run synchronously. Is there any way i can do somthing like this with the SC.get() function or is there another option?

  • 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-05-31T15:40:50+00:00Added an answer on May 31, 2026 at 3:40 pm

    Don’t do that.
    SJAX freezes the browser and is extremely annoying.

    If you really want synchronous processing, use recursion instead of a loop:

    var items = ...;
    function processItem() {
        var item = items.unshift();
        SC.get(item.id. function() { 
            ...
            if (items.length)
                processItem();
        });
    }
    

    However, it would be much faster to send all the requests at once (the way you’re doing now), then sort the results after they all come in.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

It appears to me that one way of storing data in a B-tree as
I am storing Integer objects representing an index of objects I want to track.
Im storing columns in database with users able to add and remove columns, with
I'm storing a Word document in a SQL Server 2005 database in a varbinary(max)
We are currently storing plain text passwords for a web app that we have.
What's the best storage mechanism (from the view of the database to be used
We are attempting to track links clicked on our websites by storing the session
I'm a designer who dabbles in scripting using JQuery and PHP. I have a
Consider a SQL Server 2005 database with a bunch of data on a lot
I was wondering what the best practices were for building and storing IDs. A

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.