What is the declaration syntax name of this function only works in JScript (IE)?

I recently found this code on the Internet:

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

This (weird) syntax only works in Internet Explorer (IE 8 in my case), and I wasn't sure how it was called so that I could look for it.

I just want to know if there is any documentation related to this type of functions, and if so, what are they called?

+3
source share
2 answers

This is an automatic event binding in JScript, similar to the naming convention Object_EventNamein VBScript.

See: Scripting Events

Presumably, it was removed in a later version of Internet Explorer, as well as some other rarely used non-standard features.

+1

All Articles