How can we assign an object in Java Script??

For Example:-
-----------
If i create an object "obj1"
var obj1 = Object();
obj1.name = "hari";

and if i want to assign it to two objects "obj2" and "obj3"
with different names...

obj1.name = "gopi"
obj2 = new Object(obj1);

obj1.name = "raghu"
obj3 = new Object(obj1)

Now ob2.name become to "raghu" from "gopi". WHY?
how to solve the above problem?

Answer Posted / rajesh

I maynot give the exact reason..but root cause may be
because of...

As you know the javascript is just parsed from top to
bottom. It won;t execute as long as you run the app.
While parsing it just holds the reference and checks for
syntactical errors.

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we nest the updatepanel controls? : asp.net ajax

535


Where can I find examples of ajax?

524


what is xmlhttprequest?

1847


Is ajax an api?

485


Will html_ajax integrate with other javascript ajax libraries such as scriptaculous? How would this integration look like?

547






Is adaptive path selling ajax components or trademarking the name? Where can I download it?

531


Where should I start?

552


How do we manage concurrent request?

594


How do you know that an ajax request has completed?

518


Why does html_ajax hang on some server installs?

492


Did adaptive path invent ajax? Did google? Did adaptive path help build google's ajax applications?

528


How ajax is different?

520


How to control how long an ajax request may last?

483


What are the technologies used by ajax?

524


What are the protocols and forms in ajax?

559