Skip to content
This repository was archived by the owner on Feb 2, 2021. It is now read-only.
This repository was archived by the owner on Feb 2, 2021. It is now read-only.

Selecting document, window, HTMLElements, et.c. #29

@bergmark

Description

@bergmark

It looks like the only thing you can us as a selector is String, but it's heavily overloaded in jQuery. e.g. $(document).ready, $(window).on("popstate"), $(document.body), $($("why")). Has anyone given this any thought?

I'd suggest that special operations be completely separate functions, such as ready already is for $(document).ready, and we could have selectWindow and selectDocument for $(window) and $(document) respectively. This way it is possible to use these objects as normal elements, but you can certainly misuse these. Another option would be adding a type parameter to JQuery, that way we may be able to be more granular in type signatures.

In fay-jquery we chose to only allow elements, strings, and jquery objects as input to select.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions