Skip to content

Types page does not explain how named functions can be passed #832

@Chealer

Description

@Chealer

According to http://api.jquery.com/Types/ "this page documents virtual types like Selectors, enhanced pseudo-types like Events and all and everything you wanted to know about Functions. "

http://api.jquery.com/Types/#Function mentions that "A function in JavaScript can be either named or anonymous." and provides examples of declarations:
function named() {}
var handler = function() {}

There is however not a word or example about passing named functions, which is supported by numerous jQuery functions such as .change(). The following discussion explains:
http://stackoverflow.com/questions/7963609/how-can-i-name-and-call-a-jquery-function

Note that there is no explanation there of how to read the description of functions which take Function arguments. For example, https://api.jquery.com/change/ says:
handler
Type: Function( Event eventObject )

What "Function( foo bar )" means should be specified somewhere.

This was originally reported as jquery/jquery#2704
Credits to timmywill for pointing me to the right ITS.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions