>       document.write
>       ("A.link {color: #ffffcc; text-decoration: ???? }");
>
>Etc.  So where the "????" is above I want to write in the string returned
>by GetCookie('linkline'), but I just can't make it happen.  Or whether it's
>even possible to write to an existing 'document.write' statement.  Or what
>the hell.  Sigh.


    document.write (
        "A.link {color: #ffffcc; text-decoration: " +
         GetCookie('linkline'), +
        " }"
    );


should do ya..

the parts in quotes are string literals, and the '+' signs tell the
interpreter to concatenate the list of items.   the call to GetCookie() is
out in the open (technically:  at an executable level of scope), so it gets
executed and its return value is used as the output string.


don't feel too bad.. scope issues are subtle.   experienced programmers
show their 'geekier than thou' side by spouting strange and obscure things
that can happen "if you add another set of brackets just there".

frankly, 'forgiving' languages like JS are harder to learn, syntactically,
than fascist ones like C and C++.   in rigid languages, there are fewer
special cases, and fewer core rules in general.   the downside is that you
have to do a whole bunch of work for something that's intuitively simple..
like comparing the string "316" to the number 316.   more relaxed languages
handle that kind of thing automatically, so you can concentrate on the
higher level logic of your program.   unfortunately, the side effect is
that they end up hiding a bunch of stuff under the rug, where you can't get
at it.

it's a pain in the neck to have to write a string-to-integer converter (and
more of a pain to write a string-to-float converter), but at least you know
what they do, how they do it, and when they're doing it.







mike stone  <[EMAIL PROTECTED]>   'net geek..
been there, done that,  have network, will travel.



____________________________________________________________________
--------------------------------------------------------------------
 Join The Web Consultants Association :  Register on our web site Now
Web Consultants Web Site : http://just4u.com/webconsultants
If you lose the instructions All subscription/unsubscribing can be done
directly from our website for all our lists.
---------------------------------------------------------------------

Reply via email to