zhshqzyc

root

Personally, I steer clear of google api's or frameworks, I prefer to write what I need.

If you want to produce a website with bells and whistles, then knck yourself out, however, you sould be aware of the load you put on a users connection having load a file each page, if your scripting is bespoke to your site and only contains what your site needs, your payload is less, you know what goes in to your page and how to fix things.

Wit ha framework, you rely on others code and for that code to work as expected, the only good thing I can say about frameworks is that they are designed to be cross browser compatible. That again is something I believe shouldn't happen, W3C set the standard and it is then up to browser developers to tow the line, they don't and prefer instead to go off and do their own thing because they think that they know better when the compliance issues are all created because none of them, microsoft included fails to stick to what W3C have set as the standard.

In a perfect works, one script would work in all browsers and you wouldn't need to crawl up your own rear to get your site and code working. HTML was originally designed to be readable even if an error occurs on a page, these days that is just not possible with browser manufacturers having hissy fits over what they want to do and not what they are told to do.

Padonak

you wouldn't need to crawl up your own rear - wow, perfect! thanks, Mr.Slashes, that extends my english dictionary!

root

Glad I could enlighten you Padonak.

tech_soul8

I see this thread has been marked as RESOLVED but I'm going to write my answer anyway...

Objects are unordered collection of properties where each of which has a name and a value. Object can hold it's own properties, inherited properties or combination of previous two. In JavaScript every object has another object (or null but this is rare) associated with it from which it inherits properties. In addition to it's properties each object has a prototype attribute.

Prototype - is a reference to another object from which properties are inherited.

The value of prototype attribute depends on which method you use to create your object. All objects created by object literals use Object.prototype as it's prototype. Objects created with a constructor function use constructor's function prototype property as their prototype value.

One thing to note here is that all built-in constructor functions inherits from Object.prototype and Object.prototype is the only object which has it's prototype set to null (which means it doesn't inherit any of properties). So for example arrays created by Array constructor function inherits it's properties from Array.prototype and Object.prototype. This is known as a prototype chain.

So if you want to have multiple objects which inherits same properties you can do something like this: