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?
Answers were Sorted based on User's Feedback
var obj1 = Object();
obj1.name = "hari";
obj1.name = "gopi";
obj2 = new Object(obj1);
//preserving name property of obj2 through obj4
var obj4=new Object();
obj4.name=obj2.name;
obj1.name = "raghu";
obj3 = new Object(obj1);
obj2=new Object(obj4);
alert("obj2 name="+obj2.name+" obj3 name="+obj3.name)
| Is This Answer Correct ? | 5 Yes | 3 No |
Answer / 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 |
How do I abort the current xmlhttprequest?
Don't be too quick to dump your plugin or applet based portions of your application. While ajax and dhtml can do drag and drop and other advanced user interfaces there still limitations especially when it comes to browser support. Plugins and applets have been around for a while and have been able to make ajax like requests for years. Applets provide a great set of ui components and apis that provide developers literally anything.
When will html_ajax have a stable release?
Is it compulsory to have script manager on the page when you are using any control of ajax control tool kit?
How to handle multiple or concurrent requests in ajax?
What are the important methods of xmlhttprequest?
What are the difference between AJAX and Javascript?
Describe the animation extender control and the method by which this control is utilized?
How will you update multiple records in a single shot? From an ASP.net appli to SQL Serevr
What are synchronous and asynchronous ajax requests?
What are the controls of the Script Management group?
How many validation controls are available in asp.net ajax 4.0? : asp.net ajax