Preserved Topic: The front lines of the Browser Wars (Page 1 of 1) |
|
---|---|
Maniac (V) Mad Scientist From: 127 Halcyon Road, Marenia, Atlantis |
posted 06-11-2002 19:25
I want to write some major code in Javascript and I need to make it cross-browser compatible. I want to use pointers (at least the concept- if you've programmed in C, you know what I'm talking about) to the DOM objects. |
Bipolar (III) Inmate From: Berlin (almost) |
posted 06-11-2002 20:39
AFAIK you can use a simple variable for that: |
Bipolar (III) Inmate From: USA! USA! USA! |
posted 06-11-2002 20:48
you can assign a variable to any value. if that value is not a simple data value, then it is an object reference already. so you can hold a reference to a textbox form element, but you can't hold a reference to the string value contained in it. |
Maniac (V) Mad Scientist From: 127 Halcyon Road, Marenia, Atlantis |
posted 06-11-2002 23:50 |
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
posted 06-12-2002 00:12
That's equivalent to |
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
posted 06-12-2002 06:59
This is how I do it. |
Maniac (V) Inmate From: there...no..there..... |
posted 06-12-2002 15:11
Very interesting thread. I like these discussions. Helps clear up things for me since I am trying to grasp all this myself. code: this.css = [b]this.elm[/b] = document.layers[id];
|
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
posted 06-12-2002 17:39
In some cases you may not want to affect the css properties of an element. (say if you want to write to a layer via innerHTML or .write) so you need to just refrence the layer. In NN it's the same as the style properties so I can set them all to the same thing. but in IE you have the seperate style ref. |
Maniac (V) Inmate From: there...no..there..... |
posted 06-12-2002 17:46
Oh, I see. So let me get this straight. With this: code: this.css = this.elm = document.layers[id];
|
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
posted 06-12-2002 18:08
hmm.. kinda you're on the right track. |
Maniac (V) Inmate From: there...no..there..... |
posted 06-12-2002 19:00
Right. Got it. I actually realized that but I was trying to keep the examples pertaining to what I had the question about, which was the this.elm. |