In Javascript we can declare a variable and we can call a function. The function will return a value and will be assigned to the variable. Is this possible in jQuery?
I want to know if my previous function is finished or not. I want to get the result success or failure and call another function based on first function’s result
I use a function setTimeout for blockUI.
How can I check if that timeout is due to another function?
Do .val or $.get work for the above purposes?
UPDATE: Based on your comments…
First question:
You should probably look at some of the blockUI demos.
It looks like
blockUIhas a callbackonBlock:that calls a function after thefadeInis done.Second question:
jQuery is just a library of javascript code, therefore you can assign functions to variables the same way you always do.
Third question:
You mean you want to redirect after the 3000ms
fadeInof theblockUI? You would do it in the callback that I pointed out under question 1 above. But of course this will make the entire page change, including theblockUI.Some clarification in your question is needed.
It sounds like you have a function that sets a
setTimeout()for some purpose, and that function is reused, so you need to reference the correct instance ofsetTimeout().If so, you can have your function return the
setTimeout()instance, and use that reference to clear it if needed.Is this close to what you’re asking?