Skip to content Skip to sidebar Skip to footer

Jquery Show() Function Is Not Executed In Safari If Submit Handler Returns True

Ok, I've bound a submit event handler to a form. The handler is set up to validate data, then after validation passes disable further form submittal, as well as display a 'Please w

Solution 1:

Asking this question led to the answer: JavaScript commands not executed in order in Safari

Apparently Safari renders changes to the HTML according to its internal tics. So all of the functions called are being executed in order, but are not necessarily rendered yet.

Also, rendering is halted during the execution of certain functions, alert() being one of them, and in my case, the onsubmit event! That was why I was seeing the out-of-order looking results.

So I ended up using a bit of dirtiness:

var show = function() { $('#processing_msg').show() };
            setTimeout(show,0);

Post a Comment for "Jquery Show() Function Is Not Executed In Safari If Submit Handler Returns True"