I am making plugin of some sorts, so i write:
$.fn.ajajforms=function(options)
{
var settings=jQuery.extend({ ... },options);
var objs=[];
this.each(function() { objs[objs.length]=$.ajajforms(this,settings);} )
return objs;
}
$.ajajforms=function(div,settings)
{
$("#debug").append("ajajforms constructor()\n");
$div=$(div);
var g={
settings: settings,
add_clicked: function() {...},
some more code....
};
return g;
...
}
$("#test").ajajforms();
<script>$("#test").add_clicked();</script>
but this, of course, does not work.