How do I pass the this context into an event handler?

The old/traditional way: Capture this in a variable: this.initialize = function(selector) { var that = this; $(‘span#banner1-nav’).click(function(event) { that._onClickNavigation(event); }); } You could also assign this to a variable e.g. instance: function ScrollBanner() { var instance = this; // … } and refer to instance instead of this in all the calls. The overall idea … Read more

What is the difference between Event.target, Event.toElement and Event.srcElement?

The event target is the element to which the event is dispatched: The object to which an event is targeted using the DOM event flow. The event target is the value of the Event.target attribute. srcElement is a IE non-standard way to obtain the target. The current event target is the element which has the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)