I want to set a hotkey to several functions by jquery hotkeys. And I need to check if a function is finished, may be something like:
if("function A is completed")
{
"Ctrl+A is now set to function B"
}
else
{
"Ctrl+A is set to function A"
}
How could I check this? Or any better ideas?
JavaScript on web browsers is single-threaded (barring the use of web workers, and even with those a function can't be interrupted), so except for a couple of bugs in issues with Firefox, a function cannot be interrupted in the middle. So if your code is running, the other function is not, by definition.
(For details on the issues with Firefox, see this answer by bobince about some very edge-case scenarios.)
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다