December 25, 201312 yr Hi everyone, i need help with making an object oriented javascript comment form, that can add and remove elements. I also need something else that you can do with OO in javascript?
December 31, 201312 yr Well what have you tried already? Lets see some code How my javascript do you know?
December 31, 201312 yr To demonstrate objects in JavaScript you don't have to use Dom elements, you can create a simple object as follows: var person = { 'height' : '1m80', 'weight' : '100kg' 'name' : 'John Smith' }; console.log(person.height); // outputs this persons height attribute.
January 1, 201412 yr Definitely going to need to see some code. There are 3 main styles of writing object oriented code in JavaScript so it's tricky to advise without knowing your choice; although, at a guess, you're using the prototypal style. We don't really need a full object oriented architecture to add elements to a page, simple functions will do the same job and nodes can be cloned. As for something else that you can do ... you can do as much in OO JavaScript as you can in any other aspect of JavaScript, likewise many other languages. If you're looking for basic inspiration, I'd recommend looking at JavaScript Pro Design Patterns although JavaScript Patterns covers many similar topics and is a lighter read. Edited January 1, 201412 yr by Skateside
Create an account or sign in to comment