Welcome Guest. Sign in or Signup

e) Advanced

Posted on September 18, 2012 0 Comments

How to call a base function from a overridden java script “sub class”?

To call the base function you have to access the sub function prototype which has the reference to the original base function and call it like this:

Posted on July 15, 2012 1 Comments

How to make a plain vanilla java script object start notifying changes to it’s properties?

Java Script provides an option to dynamically define properties with getters and setters. This can be used to dynamically inject property change notifying code into java script objects like this:

Posted on June 27, 2012 1 Comments

How to pass additional custom arguments to event handlers?

Some times you might want to pass additional arguments to event handlers, you can do so using the bind method when setting up listeners like this.

Posted on June 25, 2012 5 Comments

How to check if the scrollbars are currently visible?

Use the approach to determine if scrollbars are currently visible.

Posted on June 22, 2012 0 Comments

How to specify some watermark text for a text input element?

Here is a plugin that implements this feature.

Posted on June 20, 2012 0 Comments

How to make some text content in a div editable on double click?

Here is a plugin that shows how to make a text inside a div editable on double click.

Posted on June 20, 2012 0 Comments

How to “extend” a jquery method to inject some custom functionality?

Sometimes it’s useful to “extend” a jquery method to inject some additional functionality. For example, here, we extend the “val” method to make it trigger the “change” event.

Posted on May 28, 2012 1 Comments

How to listen to page close or refresh and do something useful in that event?

Here is the event (browserunload) that can be used to listen to page refresh or page close event.

Posted on May 23, 2012 0 Comments

How to get notified within an object when one of that object’s property changes?

Defining a property with get and set as follows will allow you to listen to changes to an object’s property values:

Posted on March 26, 2012 2 Comments

How to derive from an existing jQuery widget, override methods and add some functionality?

You can do this as follows: Inheritance is briefly discussed in this page as well.