I have a very simple bit of code (relies on jQuery):
var dom_builder = function() {
this.table = function(elem,attributes) {
return $("<table>").attr(attributes).appendTo(elem);
}
};
console.log(dom_builder.table);
Now when I try to run it I get the following error: Uncaught TypeError: Object # has no method 'table'
I cannot for the life of me figure out why I get this error. I have used methods this way countless times before, without any issues..
Any ideas?