[BNM] Why dosn't IE7 work with window.onload
Alex
alex at fatdrop.co.uk
Thu Nov 13 11:05:06 GMT 2008
it's case sensitive and should be onLoad iirc
I think that won't fire untill everything on the page is loaded. You
should consider using jQuery and using this instead which fires as soon
as the dom has loaded.
$(document).ready(function(){
// do something
});
David Andrew wrote:
> Hi List
>
> Been googling for a solution why this js alert won't show in IE7
>
> Can anyone point me at a succinct explanation why IE7 doesn't work
> with window.onload?
>
>
> <**code**>
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> <html>
> <head>
> <script type="text/javascript">
> window.onload = function() {
> alert("Hello world.")
> }
> </script>
> </head>
> <body>
> foo
> </body>
> </html>
>
> <**/code**>
>
--
http://www.fatdrop.co.uk - digital music services
http://blog.fatdrop.co.uk - music industry blog
FATDROP LTD | Registered in England and Wales | Company No. 6199983
More information about the BNMlist
mailing list. Powered by Wessex Networks