function onload not working for IE7 and 8

Posted by Ankita on Stack Overflow See other posts from Stack Overflow or by Ankita
Published on 2009-10-23T08:28:24Z Indexed on 2010/04/01 0:03 UTC
Read the original article Hit count: 250

Filed under:

Hi All,

My onload function is not working for IE7 and 8:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<script type="text/javascript">

  function onload()
  {
    alert("Working properly")
  }

</script>
</head>
<body>

</body>
</html>

The alert doesn't happen if I try to access it with IE7 or 8 but it's working properly in Mozilla.

Can anyone suggest something which works for both IE and Mozilla?

© Stack Overflow or respective owner

Related posts about html