I've been using this code for quite some time, but am wondering if there's any improvements I can make to it. Basically it's just code that runs when the page loads or if the code is run after page load, it will run right away. Do you see any cross browser compatibility issues or any more efficient ways of writing this?
ol() is a predefined function to be run.
(document.readyState=='complete') ? ol():(window.addEventListener&&window.addEventListener("load",ol,false)|| window.attachEvent&&window.attachEvent("onload",ol));