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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T18:29:08+00:00 2026-06-01T18:29:08+00:00

I have a site that gets a user data on logging in. this data

  • 0

I have a site that gets a user data on logging in.
this data is saved by mysql as a string, and after calling this string with ajax, I split the data by js function: str.split().
this returns an array with all the id’s of the btns I would like to check, and with the “.each” call I check all matched btns.
the big problem is that this process takes about 10 seconds on local server.
is there a better and faster way to get user data?
p.s: we talk about hundreds of btns on user login.

here is the code:

function get_saved_list(){
    $.ajax({
        type: "post",
        url: "ajax/get_saved_list.php",
        success: function(data){
            list=data.split(";");
            for(j=0; j<list.length-1; j++){
                $(".content #"+list[j]).siblings('a').trigger('click');
            }
            setTimeout("$('#save').hide()", 1);
        }
    });     
}

some of the html include the ‘a’ that is triggered:

<ul class="content"><li>
<a class="third_cat_chb cat_chb_off"></a><span>page</span>
                                        <button id="page_<?php echo $row['page']."Z"; ?>chapter_<?php echo $row['s_id'];?>" style="width: 20px; margin-right: 5px;" class="page_chooser"></button></li></ul>

sory for the bad format : )

  • 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-01T18:29:10+00:00Added an answer on June 1, 2026 at 6:29 pm

    Don’t prefix your ID selector with a class. This prohibits jQuery from using the native getElementById(), and instead uses getElementsByClassName(), which is slower.

    Try this selector instead: $("#"+list[j])

    I was able to loop through 1000 items and trigger a click in about 1 second, rather than 4-5 seconds by doing a class first.

    It would also help if you could put an ID on the actual <a> that you want to click so that you can avoid the call to siblings(), which adds additional overhead.

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

Sidebar

Related Questions

I've built a Repository that gets user details Public Function GetUserByOpenID(ByVal openid As String)
I have created an App that gets data from Web Services on an In
I'm programming a site in PHP/MySQL that gets search results for products via API
I have a table with weekly data that looks like: userID Site date ------
I have an NSURL object which gets data from my site, based on a
I have a public facing hobby site that gets about 3000 unique visitors a
I have this very simple script that allows the user to specify the url
I have a site that requires Windows Authentication the application obtains the credential from
I have a site that is using x509 client certificates (2 way SSL) to
I have a site that usually has news items at the top of the

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.