Is JavaScript single threaded? If not, how do I get synchronized access to shared data?

前端 未结 7 1921
执笔经年
执笔经年 2020-12-17 01:12

I have a web page with DIVs with a mouseover handler that is intended to show a pop-up information bubble. I don\'t want more than one info bubble

7条回答
  •  Happy的楠姐
    2020-12-17 01:30

    Yes, Javascript is single-threaded. Even with browsers like Google Chrome, there is one thread per tab.

    Without knowing how you are trying to cancel one pop-up from another, it's hard to say what is the cause of your problem.

    If your DIVs are nested within one another, you may have an event propagation issue.

提交回复
热议问题