javascript-objects

How JavaScript does OOP?

I am learning about creating objects in JavaScript. When I do this ... var Person = { name: "John Doe", sayHi: function() { alert("Hi"); } }; I know that I am creating an instance of a Person class, but I do not know how (or if) I can reuse that class to create another instance. What OOP features does JavaScript has? Does...

jQuery Datalink not working with object methods

Hi, I have a javascript object with several properties. The object also contains an instance method that returns the result of a calculation on two of the object's properties. I'm using the new Jquery .link() plugin (http://api.jquery.com/link/), to update the UI and form elements with the object property values and vice versa, whenev...

What are the differences between JSON and JavaScript object?

I am new to JSON and JavaScript object. -Can anyone please explain the differences between JSON and JavaScript object? -What are their uses? -Is one better than the other? or it depends on the situation? -When to use which one, in what situation? -Why JSON was created in the first place? What was the main purpose? -Can someone give exa...

Dynamicly add values to and sort Javscript Object

Lets say i have this array of movie directors: var directors = ['Woody Allen', 'Woody Allen', 'Clint Eastwood', 'Quentin Tarantino', 'Robert Rodriguez', 'Woody Allen', 'Steven Soderberg', 'Robert Rodriguez, Quentin Tarantino' ]; A PHP print_r of the aray would look like this: Array ( [0] => Woody Allen [1] => Woody Allen ...