Wednesday, June 24, 2009

window.onload firefox,IE

<html>
    <head>
        <script language='javascript'>    
            
            var browserName = navigator.appName;
            
            if (browserName == "Microsoft Internet Explorer") {    
            
                window.onload = function(){alert('IE Onload');}
            }
            else {
                if (document.addEventListener){
                
                    document.addEventListener("DOMContentLoaded", function(){alert('Firefox Onload');}, false);
                    
                }
            }
        </script>
    </head>
    <body>
        replacement for    window.onload in Firefox
    </body>
</html>

2 comments:

Ian.J.Gough said...

PPPerfect just what i was looking for and have been for the last few hours "window.onload firefox,IE"
All the best and thanks again,
Ian
IanJGough.Com

Anonymous said...

I would like to exchange links with your site www.blogger.com
Is this possible?