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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:19:17+00:00 2026-06-15T11:19:17+00:00

I have a web page (JavaScript) that has two types of events: Click event

  • 0

I have a web page (JavaScript) that has two types of events:

  • Click event in a canvas (only displays an alert).
  • Periodic event (fired by a timer) every second.

The periodic event is busy for 200 – 300 ms (it’s launching a synchronous SOAP call).

The canvas event:

var c=document.getElementById("myCanvas");
 c.addEventListener('click', function(e) {alert('Click');},false);

The periodic:

var timer1= new Timer(1000,"Refresh()"); // A library call


function Refresh()
{   
    timer1.stop();

    // Synchronous SOAP call would come here

    // with the results we draw the canvas again

    timer1.start();
}

If I click in the canvas while the SOAP call is being made, the click event is not being fired, or so I assume, because the alert is not shown.

If I click once the periodic event is finished and before it gets called again, every click shows the alert.

From what I know, if the click event is generated while the periodic event is being executed, it should be delayed until the other one is finished.

What could be causing the problem?

P.D. I’m using Firebug (on Firefox) to know when the SOAP call is being made.

  • 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-15T11:19:18+00:00Added an answer on June 15, 2026 at 11:19 am

    Synchronous calls block the I/O, so the alerts would not be fired. Since you are waiting for a return for your call, any actions that happen during that time will be ignored.

    This article may prove to be helpful: http://ejohn.org/blog/how-javascript-timers-work/

    Since all JavaScript in a browser executes on a single thread
    asynchronous events (such as mouse clicks and timers) are only run
    when there’s been an opening in the execution.

    • JavaScript engines only have a single thread, forcing asynchronous events to queue waiting for execution.
    • setTimeout and setInterval are fundamentally different in how they execute asynchronous code.
    • If atimer is blocked from immediately executing it will be delayed until the next possible point of execution (which will be longer
      than the desired delay).
    • Intervals may execute back-to-back with no delay if they take long enough to execute (longer than the specified delay).
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have web forms page that has 2 controls. A gridview and an associated
My boss has asked for a page that will not change to have two
I have a web page that shows a table of data. My page has
I have a one page web application, which means alot of javascript. External scripts
I have web page in PHP which displays all records in a table. I
new on rails and using windows for now,, i have web page that user
I have a web page that prompts for user input via DropDownLists in some
I have two lists displaying on a web page: (List of Clients) (List of
I am developing a website that has two back to back web broadcasts. I
I have a resources web app, which only has static content, such as images,

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.