Is JavaScript single threaded? If not, how do I get synchronized access to shared data?
问题 I have a web page with DIV s with a mouseover handler that is intended to show a pop-up information bubble. I don't want more than one info bubble to be visible at a time. But when the user moves the mouse rapidly over two items, I sometimes get two bubbles. This should not happen, because the code for showing a pop-up cancels the previous pop-up. If this were a multi-threaded system then the problem would be obvious: there are two threads trying to show a pop-up, and they both cancel