Menu
I’ve seen a couple of examples of sites using code similar to the following to create widgets.
[CODE]
var foo = {
f : function(e){
alert(e + 4);
},
};
new foo.f({
word: ‘test’,
backgroundColor: ‘blue’,
width: 250,
height: 300,
});
How does this work? I mean I want to be able to append to or create an element using what I’ve supplied to in new foo.f.
What is best practice in creating a javascript widget?