Topic awaiting preservation: sending style attributes to function (Page 1 of 1) |
|
---|---|
Paranoid (IV) Inmate From: Northumberland, England |
posted 09-04-2003 17:37
hi, please can you help, |
Nervous Wreck (II) Inmate From: |
posted 09-04-2003 18:52
Try this instead: code: getElementById('myDiv').style.setProperty(TYPE,'#FFFFFF');
|
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
posted 09-04-2003 19:14
He's got a better method but the root of your problem is that accessing elements like that doesn't resolve variables. |
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
posted 09-04-2003 19:57
No no no, eval function calls are *not* needed to turn strings into properties! JavaScript has a specific method for handling this: |
Paranoid (IV) Inmate From: Northumberland, England |
posted 09-04-2003 21:35
Ah, I see, so just like in Actionscript then slime, cool. I stupidly never tried that method although I had thought about it - I automatically assumed it would end up calling some non-existent associative array, so now you see why I'm not cut out to be a coder. |
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
posted 09-05-2003 00:57
It *does* sort of index an array. Or, more accurately, arrays are the same as objects, and when you do myArray[0], that's *almost* exactly the same as myArray.0 (the only difference is that the latter isn't valid syntax, since properties have to start with letters). So, internally, that's pretty much what's going on. |
Paranoid (IV) Inmate From: Northumberland, England |
posted 09-05-2003 10:24
I know about the ECMAScript standard - netscape made JavaScript, then some people came along and standardised the whole thing into ECMAScript then MM made ActionScript from the ECMAScript standard, which is now also followed by JavaScript - or somethign along those lines. ActionScript 2.0 is even more standards compliant apparently. |
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
posted 09-06-2003 00:35
Technically, I think it's a language in it's own right. However, it's useless in the sense that it doesn't contain any methods of *doing* anything. Only when a language (JavaScript, ActionScript) is based on it, and given predefined objects to work with (like the document object) does it have any power. So, in that sense, it's sort of a "base" language. |
Maniac (V) Mad Scientist From: 127 Halcyon Road, Marenia, Atlantis |
posted 09-07-2003 05:23
wow... that kinda sucks.... 'an emasculated language useful only as a skeleton set for new languages' |