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

  • Home
  • SEARCH
  • 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 9084293
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T20:57:54+00:00 2026-06-16T20:57:54+00:00

Imagine this scenario: I have a link that fires up a JavaScript function(has an

  • 0

Imagine this scenario:

  1. I have a link that fires up a JavaScript function(has an Ajax request in it).

  2. The JavaScript function has a parameter passed by the link’s onclick=’jsFunction(param)’.

  3. The JavaScript function sends the parameter value in a function inside a controller that sets the param value to a session variable.

  4. The function in the controller will then send the new value of the session variable back to the JavaScript function’s Ajax request.

  5. When the data reached into the Ajax request, another function will be called using the data being passed.

Question:

Since I am talking about the session variable’s value being passed to an Ajax request, how can I process the data came from the link to the second function in real-time? I want to post the code here but it’s too verbose with the info I only need.

The current state of my code is that, I can’t fetch the right/latest data. Instead, I get the previous data came from the previous link I clicked.

Is there an Ajax feature that I can only proceed to the next function if the first function is done processing the latest data?

Any help will be much appreciated.

  • 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-16T20:57:56+00:00Added an answer on June 16, 2026 at 8:57 pm

    You can use the callback to any of the jQuery AJAX methods to delay execution of another function until after the request is complete.

       $.post('/some/url', somedata, function(returnData) {
            // put the code you want to execute on completion here
       });
    

    or If you have already defined your function to be called after returning data, you can just write like this:

       $.post('/some/url', somedata, processData);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Imagine this scenario: You have a desktop and a laptop. The desktop has a
So imagine this scenario, I have a list and it has a bit of
Imagine this scenario: you have a WCF web service that gets hit up to
Imagine this scenario: in our company there is an employee that play around graphic,css,html
In this simplified scenario, I have a model called Post Each post has a
Imagine this scenario. I have a wsdl file with namespace a/b/c and it imports
Imagine I have this scenario in my Controller: def nr_1 = params.first_nr def nr_2
Imagine this scenario: I have a ZPT in Zope where I define, into a
Imagine this scenario: I have three tables in my database: Products , Users and
I imagine this has a rather simple answer <% for user in @users %>

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.