Safari Doesn’t Care About Your JavaScript On Submit

Recently I was implementing some new code to show a user that an order was processing. Pretty standard stuff with overlays, hiding the submit button etc… While going through routine testing in various browsers I noticed that the implementation was not working in Safari. Oddly it turns out that when you submit a form via JavaScript in Safari it decides to pretty much not execute anything else. A stackoverflow thread touched up on this a bit, along with a potential solution.

Here we have a sample of the code that doesn’t work as expected in Safari:

The solution is to use setTimeout as a poor mans queue.

I can’t understand why Safari operates differently in this respect. All other major browsers work as expected including Internet Explorer. With some other odd behavior I’ve seen out of Safari lately, I think its quickly becoming the new IE6.