Reputation: 187529
I've defined the following JS constructor function
function FV.Map(element) {
// impl omitted
}
The function definition causes the following error to appear in Firebug
missing ( before formal parameters
The FV is a global object that I use as a namespace for all my functions. Apparently this is not the right way to add this function to this namespace, what should I use instead?
Upvotes: 1
Views: 3270
Reputation: 193
A more intuitive syntax would perhaps be this...
window.FV = {
Map: function(element){
Do Something
},
Morefuncs: function(element, element2){
Do something else
}
};
Upvotes: 0
Reputation: 39950
window.FV = window.FV || {}
FV.Map = function(element) {
//…
}
Upvotes: 3