Skip to content

Passing in arbitrary values. #42

@cnobile2012

Description

@cnobile2012

jQuery itself when binding a function/method to an object allows you to pass in arbitrary objects in the 2nd argument as in:

$('#someId').bind('click', {self: this}, this.method);

A method is then called like this:

event.data.self.anotherMethod(); This is an instance call.

The above is extremely useful when writing good OO code in JavaScript. I really don't like having to do the following, in my code:

ClassName.prototype.anotherMethod(); This is a static call.

This is very ugly in my opinion. I realize that JavaScript is not an OO language like Java or Python, etc, but I feel this is still a better option than a static call to the method.

So I guess what I am asking is, is it possible to allow something like this as an argument in your modal options for example?

Carl

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