<html>
<body>
<script language="javascript">
var func = function(){return function(){}};//declare a function var name
func.fn = func.prototype = {constructor:func,init:function(){this.vee = 'vee';return this;},method:'method',complete:function(){alert('ok');}};
func.fn.init.prototype = func.fn;//set the func.fn.init.prototype as object of {constructor:func,init:function(){this.vee = ...}...
var v = func.fn.init();// equal the new init;
var s = new func.fn.init;// new a object;
alert(v);//result 'vee';
/*
var init=function(){this.vee = 'svee';this.complete=function(){alert(this.vee);}; return this;}
//var v2 = new v.init;
var s = init();
s.vee = 'change';
s.complete();//result 'change'
var k = init();
//k.vee = 'kchange';
k.complete();*///result 'kchange'
</script>
</body>
</html>
<body>
<script language="javascript">
var func = function(){return function(){}};//declare a function var name
func.fn = func.prototype = {constructor:func,init:function(){this.vee = 'vee';return this;},method:'method',complete:function(){alert('ok');}};
func.fn.init.prototype = func.fn;//set the func.fn.init.prototype as object of {constructor:func,init:function(){this.vee = ...}...
var v = func.fn.init();// equal the new init;
var s = new func.fn.init;// new a object;
alert(v);//result 'vee';
/*
var init=function(){this.vee = 'svee';this.complete=function(){alert(this.vee);}; return this;}
//var v2 = new v.init;
var s = init();
s.vee = 'change';
s.complete();//result 'change'
var k = init();
//k.vee = 'kchange';
k.complete();*///result 'kchange'
</script>
</body>
</html>