dhgamache/Tic-Tac-Toe-JS — comment on commit dfe71893976cd104bad4795e7c55da7771a369c4
File: tictactoe.js line 14
By fat:

so this is what is happening...

when you `.click( foo )` youre passing a reference foo through to jquery... which is essentially taking your reference and binding it as a click even handler directly to an element... in sane browsers that would look like:

```js
$.fn.click = function (yourHandler) {
return this.each(function () {
this.addEventListener('click', yourHandler, false)
})
}
```
when the click event is triggered your reference is being called and the event is going to your method foo.

what you were doing before was adding an unnecessary anonymous function to the mix - but it's not needed because your handler is expecting the same arguments as the event listener is being given