Basically Dub and Dub.socialize objects already exist as an included library. I'm trying to extend the library with some additional custom functions that I created.
I attempted the following concept below:
Dub.socialize = {
setUID : function(preUID, postUID)
{
// .. function code here
}
}
However, I receive the following error "Uncaught TypeError: Cannot set property 'setUID' of undefined" from my console.
Obviously my knowledge of objects is a bit misled. What would be the proper method of extending this function into the already existing object library?
setUID?Dub.socialize.setUID = ...;?Dub.socializealready exists, you can doDub.socialize.setUID = function ()...Dub.socializealready exists, he must do it the way you showed, with his code he loses the existing object with all its existing methods/properties.