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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T16:46:30+00:00 2026-05-15T16:46:30+00:00

Assume, for whatever reason, that we have three inline scripts on a page. Each

  • 0

Assume, for whatever reason, that we have three inline scripts on a page. Each of these scripts are functionally the same, and all three will create a script tag, with the source set to a server-side script (each with slightly different parameters) which returns JS to execute. Assume this JS contains a global variable containing important parameters for the function it calls at the end.

var g_important = {"arbitrary1":"someval1", "arbitrary2":"someval2"};
doSomething();

The script in question resides on a CDN with a load balancer. Assume that each request from our original JS could actually be sent to a different server. The response time from the server is now variable, meaning we might get our response to the second request first. That’s not a problem because we send a reference value back with the code, ensuring that we’re at least working with the specified object.

My question is: what happens when we get two responses at roughly the same time? This is a very unlikely case, but if the first response is in the process of executing doSomething() when the second response comes in, what does the browser do? Does it parse the value for the variable and push the second doSomething call onto the stack?

Assuming this is the case, doSomething could be working with the wrong set of values in theory. I can’t recreate this case, as the timing would have to be absolutely perfect, but I need to know if it’s a problem.

  • 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-15T16:46:32+00:00Added an answer on May 15, 2026 at 4:46 pm

    Javascript operates “one line at a time”. Scripts will always be stacked if another script is running.

    And technically, 2 scripts cannot be loaded at the same time, so 1 will be executed before the other.

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

Sidebar

Related Questions

Assume that we have two sets: A=(a_1,a_2,...,a_m) and B=(b_1,b_2,...,a_n) (Not necessarily of same size).
Let's assume we have simple UI and for whatever reason, every 5 seconds a
For the moment assume that I have access to my own server so I
Assume that we have two tables: Roles and Reports . And there exists a
Lets say I have a FB app I've created, and for whatever reason the
I'm trying to build an app for SharePoint in C# that will have a
Assume I have two tables, Student Test Id Name TestId Type StudentId -- ----
Assume I have an enumerable object enum and now I want to get the
Assume I have the following ; def test(): while 1: a = b time.sleep(60)
Assume I have an image uploaded to a store on Shopify called 'logo.png'. In

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.