3

I recently came upon this code on the web :

function window::onload() {
    alert('onload!');
}

This (strange) syntax is only working in Internet Explorer (IE 8 in my case) and I wasn't sure of how it was called so I could search for it.

I simply want to know if there is some documentation related to this type of functions and if so, how are they called ?

Philippe97
  • 380
  • 4
  • 9

2 Answers2

1

That is automatic event binding in JScript, similar to the Object_EventName naming convention in VBScript.

See: Scripting Events

Supposedly it has meen removed in later version of Internet Explorer, just as some other rarely used non-standard features.

Guffa
  • 687,336
  • 108
  • 737
  • 1,005
  • it's not that it was removed per se, it's that IE switched from jScript to javascript... – dandavis Feb 17 '14 at 00:19
  • @dandavis: Do you have any reference for that? I have never heard of such a switch, and from what I can find it still uses the Chakra JScript engine in the latest version; IE 11. – Guffa Feb 17 '14 at 12:45
  • JScript is just a name. i probably should have said ECMAScript since we are discussing semantics. If anyone is not allowed to say "JavaScript", it's M$. The important change is ES5 compliance, which IE never sought or achieved with ES3 and prior versions of JScript. Gaining the inter-operable ES5 compliance means that proprietary JScript-only syntax will not work... I didn't mean to imply they struck a deal with Sun. – dandavis Feb 17 '14 at 17:29
0

MS-ES5EX ECMAScript extension for Event Handler Function Definitions

http://msdn.microsoft.com/en-us/library/ff955429.aspx

Ilya Kozhevnikov
  • 10,242
  • 4
  • 40
  • 70