3 ms·
If it behaves differently in FireFox and Chrome and it's inconsistent, it's usually an issue with the speed of JavaScript execution and the order of the JavaScr
by JangoSteve 16y ago
If it behaves differently in FireFox and Chrome and it's inconsistent, it's usually an issue with the speed of JavaScript execution and the order of the JavaScript operations.
If it works in FireFox but not Chrome, it usually indicates a problem with the JavaScript executing too quickly. E.g. computing the width of one element and setting it based on the width of another element on the page, before the content of that other element has been fully rendered.
If it works in Chrome but not FireFox, it usually indicates a problem with the JavaScript executing too slowly. E.g. firing off an intensive process, like manipulating 100 elements on the page at once, and then firing off another action that depends on the previous process being completed. If the JavaScript execution is slow, it's possible to fire off the next event while the other is still being processed.
In this case you'll want to either have the previous function fire off an event when it's completed, and bind the next function to that event, or brute force it with a setTimeout.
Wow, that was way longer than I meant it to be. Oh well, hope it helps.