Subj : JavaScript behavior in Seamonkey To : "'mozilla-jseng@mozilla.org'" From : SCheung@Novarra.com (Samuel Cheung) Date : Sat Sep 13 2003 07:22 pm This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_001_01C37A23.EF00B1B0 Content-Type: text/plain; charset="iso-8859-1" Hi, I try the following page in Mozilla: In IE, the function f1 will not execute, but in Mozilla it does. So I think in IE, "var onload = f1;" does not update the "onload" attribute of the window object, but in Mozilla it does go ahead and update the "onload" attribute even the variable is declared with "var". Could someone please tell me why Mozilla does that? I think if Mozilla looks for any matching window properpty (in this case "onload") for every single variable declaration. That will be slow. So I am wondering what is the reason behind this behavior? Thanks. Sam ------_=_NextPart_001_01C37A23.EF00B1B0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable JavaScript behavior in Seamonkey

Hi,

I try the following page in Mozilla:

<html>
<body>
<script>
function f1() {
alert('calling f1().');
}
// does not call f1 after the page is loaded in IE, = but in Mozilla, it does call that function
var onload =3D f1;
alert("end script");
</script>
</body>
</html>

In IE, the function f1 will not execute, but in = Mozilla it does.
So I think in IE, "var onload =3D f1;" = does not update the "onload" attribute of the window object, = but in Mozilla it does go ahead and update the "onload" = attribute even the variable is declared with "var". =

Could someone please tell me why Mozilla does that? I = think if Mozilla looks for any matching window properpty (in this case = "onload") for every single variable declaration. That will be = slow. So I am wondering what is the reason behind this behavior? =

Thanks.

Sam

------_=_NextPart_001_01C37A23.EF00B1B0-- .