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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T13:30:31+00:00 2026-06-17T13:30:31+00:00

I have a simple resizable div (achieved with jQuery’s resizable ) and I’m handling

  • 0

I have a simple resizable div (achieved with jQuery’s resizable) and I’m handling the resize event with a function.

So, let’s say that’s my code:

var a = ...
$(div).resizable({ 
    options go here...

    resize: function(e, ui){
        make some operations with a
        ...
        ...
        keep making operations with a
        ...
        ...
        ok, we're done
    }
})

Now, let’s say the resize callback is called a lot of times in a short period of time. How will javascript handle that? Will callbacks overlap the use of “a”? (Note that “a” is a global var!).
Am I safe with this code or there might be a conflict of some kind?

Regards

  • 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-17T13:30:32+00:00Added an answer on June 17, 2026 at 1:30 pm

    JavaScript is single-threaded so the function calls can’t “overlap”. If you trigger the event multiple times then the function is executed entirely (minus any asynchronous functions it may call) in response to the first triggering, before it’s executed again to handle the subsequent triggers.

    However, changes to a in one call will still have been made when the function is executed again, so if it relies on the value of a you may run into problems – it comes down to exactly what that function is doing with the variable.

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

Sidebar

Related Questions

I am using the resizable() function from jQuery to resize a div which contains
I have made a DIV resizable in jQuery, like this: $(#myDiv).resizable(); Simple, Now is
i have simple chrome extension that opens JQuery dialog box on each tab i
I have a simple jQuery dialog box that has an html input inside it.
I have the following code in Javascript: jQuery(document).ready(function(){ var actions = new Object(); var
I have simple php validation form that is halfway working. If you leave the
I have simple win service, that executes few tasks periodically. How should I pass
Hello I currently have a site that is very simple. It consists of a
Well... that's it. I need something simple and reliable (doesn't have to have fancy
I'm trying to create a simple login system that will have the forms and

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.