scanreg — 2013-02-28T12:25:22-05:00 — #1
on page 135 there is the following excerpt from tooltips.js:
why is showTip using "this" but preventDefault using "event" ?
why is hideTip using "this" when "event" is the parameter?
i know it's right under my nose but i'm not quite getting it
pullo — 2013-02-28T14:50:40-05:00 — #2
this refers to the element on the page which triggered the event, so in this case an anchor element.
event is a MouseEvent, who's default action needs preventing.
this is available within the scope of the function, without having to pass it explicitly as a parameter.
You could also write:
and leave out the event entirely.
scanreg — 2013-03-01T11:09:26-05:00 — #3
ah, thanks, getting clearer, will re-read this section but much better
this is available within the scope of the function
i remember reading about 'this' and scope within and outside of a function, will re-read this section of the book