Periods in Javascript function definition (function window.onload(){})
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/8306445/javascript-function-syntax-explanation-function-object-myfunction">JavaScript Function Syntax Explanation: function object.myFunction(){..}</a>  </p>
</blockquote>



<p>I've seen some (legacy) javascript code recently that looks like:</p>

<pre><code>function window.onload(){
  // some code
}
</code></pre>

<p>This doesn't look like valid javascript to me since you can't have a period in an identifier, but it seems to work in IE8. I assume it's the equivalent of:</p>

<pre><code>window.onload = function(){}
</code></pre>

<p>I've tried the same code in Chrome and IE9 and both of them raise syntax exceptions, so am I correct in thinking that this "feature" of IE8 is some non-standard function definition that should be replaced? The code in question is only sent to IE browsers, so that's probably why I haven't run into this issue before.</p>
