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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:50:16+00:00 2026-05-25T21:50:16+00:00

I am have a JavaScript that is not running in sequence. The script establishes

  • 0

I am have a JavaScript that is not running in sequence. The script establishes an unload function. It uses the $.get jQuery command to retrieve a file, then it is supposed to print the file to the external device. I added some alert boxes, so I would know whether it is running every function, and I discovered it is trying to print before it is retrieving the file. I changed my code so it retrieved the file on an unload function, the prints the file on an on click function and it works perfectly. Is there a reason the it is running the $.get command out of sequence?

  • 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-25T21:50:17+00:00Added an answer on May 25, 2026 at 9:50 pm

    AJAX requests get sent, but the processing continues – it does not stall until the response is received.

    So if you want things to go sequentially you need to do the processing in a closure:

    $.get(url, function(response)
    {
       // Process the response
    
       // do other stuff
    };
    

    Not:

    $.get(url);
    
    // do other stuff
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have to maintain a server-side script written in JScript (NOT Javascript) that needs
I have JavaScript that is doing activity periodically. When the user is not looking
It's not that I don't have access to javascript, of course. In most of
I have some javascript that I'm trying to retool using jQuery to learn the
I have a javascript that calls a function each 1 minute. That function sends
Ok, I have one JavaScript that creates rows in a table like this: function
I have a JavaScript application that uses XMLHttpRequest to fetch and parse about 60,000
I have a JavaScript WYSIWYG editor (not unlike CKEditor) running on a site. It
I have Javascript that opens another window and registers a click handler for all
I have some javascript that goes out and fetches a javascript class on another

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.