Learned this myself recently.

http://developer.irt.org/script/878.htm

Essentially, there is no way to do what you are trying to do. 

What other developers do is loop around all of the object's properties
and copy them to the new object.

M

-----Original Message-----
From: Ian Skinner [mailto:[EMAIL PROTECTED] 
Sent: Thursday, July 31, 2003 2:04 PM
To: CF-Talk
Subject: OT JavaScript Object Copy


Apparently this is much more difficult then it probably should be.  But
I can figure out how to make a true copy of DOM object with JavaScript,
instead of just a copy of the pointer to the object.

For Example:

protoRow = (document.getElementById("One"));

I would like protoRow to be a true deep copy of the current state of row
"One", that I can use later on to create new rows, even though by that
time the state of row one will have change significantly.  This
obviously only creates a copy of the pointer to row "One" and any new
rows made with this will have the current properties of row "One" what
ever they happen to be at the time.

Thanks

--------------
Ian Skinner
Web Programmer
BloodSource
Sacramento, CA


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. 
http://www.fusionauthority.com/signup.cfm

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to