S
S
sajgak2011-04-04 14:02:35
JavaScript
sajgak, 2011-04-04 14:02:35

jquery check for live handler?

Are there any developments on the subject?

It is clear that isDefaultPrevented does not work (which is a pity :)).

It is necessary in order to execute the function in the event that no handler is attached to the element (including live and direct attachments).
Of course, you can add a special class for such elements, for example, but you don’t want to shovel the entire html code.

Thanks

Answer the question

In order to leave comments, you need to log in

4 answer(s)
R
Riateche, 2011-04-04
@Riateche

Write a wrapper for live (something like jQuery.fn.my_live) that uses data() to mark the hung handler in the object, and then calls live. And throughout the code, replace live with my_live. In the future, using data, look for a mark in the object: if it is not there, then there is no handler.

A
Anatoly, 2011-04-04
@taliban

you can check any handler except live and delegate.

1
1nd1go, 2011-07-06
@1nd1go

Inside there is an array of handlers: handlers is called. You can search by code. It seems to be possible to get it through data ("events"). So, accordingly, a decision is made on the presence of handlers.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question