Javascript question? 
Author Message
 Javascript question?

Does anybody know how to do something like:

document = new Object();
document.x = 5;
x = document.x;
.
.
.
such that when the value of document.x changes, the
variable x will get updated w/ the new value.

The way it's written above, x will not get updated
automatically when i change the value of document.x
after the assignment of x = document.x.

Thanks,
Tom



Sat, 12 Jul 2003 03:39:28 GMT  
 Javascript question?
Hmmm, sounds like x/y=t*u-4+33=x+y*u/t  ;-)

Sorry, just having some very late night fun at your expense!

Anyway, I am assuming you are referring to something like this...
<xmp>
// in a form, for example
var x="500";
if(document.myObj.value != x)
    document.myObj.value = x;
</xmp>
Yes/no?

Quote:
> Does anybody know how to do something like:

> document = new Object();
> document.x = 5;
> x = document.x;
> .
> .
> .
> such that when the value of document.x changes, the
> variable x will get updated w/ the new value.

> The way it's written above, x will not get updated
> automatically when i change the value of document.x
> after the assignment of x = document.x.

> Thanks,
> Tom




Sat, 12 Jul 2003 15:27:24 GMT  
 Javascript question?
I think that variable x has its own location for the value like this, say:

_x  dd  ?                        ;internal variable
x    dd  OFFSET _x       ;pointer

when you do

                                   x = document.x

this should mean you copy the value of document.x into internal _x, so that
you have two copies of the value of document.x.
MK.



Sat, 12 Jul 2003 15:43:52 GMT  
 Javascript question?
OK, I've not been precise. I have another suggestions.
Variable x is also the object variable, but when you use it the first time
via assigning the value of predefined objects like String or Number the
proper constructor is invoked. You can not create C pointers on such
objects.


Sat, 12 Jul 2003 16:04:23 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. VBScript to Javascript question

2. Advanced JavaScript Question - IE - Permission denied Error

3. CSS/JavaScript question (IE4 explicit)

4. Javascript question...

5. Another Netscape Javascript question

6. BIG dhtml/javascript question?

7. I need to ask a Javascript question: NS Specific - CSS Sheets

8. vbscript javascript question

9. server side vbscript /javascript question

10. Javascript Question

11. VBScript to Javascript question

12. vbscript / javascript question

 

 
Powered by phpBB® Forum Software