HighDots Forums  

json in array -> overlap problem

Javascript JavaScript language (comp.lang.javascript)


Discuss json in array -> overlap problem in the Javascript forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
pistacchio
 
Posts: n/a

Default json in array -> overlap problem - 07-19-2007 , 10:56 AM






hi to all!

having a problem with javascript, i've stripped the script down to a
few lines in order to post it here asking for help.

<code>
var objs = new Array();
obj = {
parameter : ''
}

objs[0] = obj;
objs[0].parameter = "apple";

objs[1] = obj;
objs[1].parameter = "banana";

alert(objs[0].parameter);
</code>

i insert the json object obj into the array and change the parameter.
now, i expect the alert to return "apple", while i keep getting
"banana", as, in some unpredictable way, the value has been
overlapped.
any help?
tia - gustavo


Reply With Quote
  #2  
Old   
d d
 
Posts: n/a

Default Re: json in array -> overlap problem - 07-19-2007 , 11:07 AM






pistacchio wrote:
Quote:
any help?
More help? You didn't like the first help?

You got two different answers, both of which would work.

~dd


Reply With Quote
  #3  
Old   
pistacchio
 
Posts: n/a

Default Re: json in array -> overlap problem - 07-19-2007 , 12:22 PM



d d ha scritto:
Quote:
pistacchio wrote:
any help?

More help? You didn't like the first help?

You got two different answers, both of which would work.

~dd
i'm sorry, dd. i was using google groups and i think it doesn't work in
these days. i couldn't see my post and the answers. sorry and thanks for
the help!


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.