Andrey (azangru) wrote,

Ущипните меня! На обычном объекте, не DOM-элементе, можно делать такое:

var a = $({}).on('click', function(){console.log('WTF?')});

// =>  WTF?

Это мне как раз очень на руку, я замочил во время тестов window, а потом понял, что у меня на него обработчик событий вешается. Так что я щаслив. Но блин, какой нежданчик!

  • (no subject)

    This is bullshit, right? Immediately after the 1917 revolution education was in shambles. And there were still several years of the civil war to…

  • (no subject)

    I was stumped by the asterisks in the second bleeped word. Could only think of hand, but that's not what it was. In any case, it's a perfectly…

  • (no subject)

    Which/whose corporate interests is he talking about? Which corporations are interested in what? I am so confused.

  • Post a new comment


    default userpic
    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.