Define function for property of javascript class
I have this Javascript class and want to add some kind of function (like
prototype) to properties of this class.
function theUploader(virtualField)
{
var self = this;
//self.v = virtualField;
self.v = (function(){return self.v; this.clear = function(){self.v =
'';}})()
self.v.prototype = function clear() {
self.v = '';
}
}
i tried those lines. i couldn`t find out the right way to define such a
thing.i want to call it like this
var temp = new theUploader('smart');
temp.v.clear();
someone guid me with jsaon.but still working on it
No comments:
Post a Comment