views:

95

answers:

1

I'm developing an editing component (iframe-based) in JQuery.

My intention is to make it easy to extend the functionality of the editor through plug-ins. So for example, you might make a plug-in that puts wavy underlines underneath spelling mistakes, or allows images to be inserted, etc.

I'm happy to work out the technicalities of this myself, but I'm finding it difficult to decide how to architect the API.

The editor itself is currently a plug-in. You instantiate it through code such as the following:

$("#id_of_a_div").editComponent();

Does JQuery allow you to have plug-ins inside plug-ins? Or is there some better way of achieving this?

+1  A: 

You should take a look at jQuery.ui guidelines. There mentions the draggable component as an example of a plugin with plugins.

Serhii