[Date Prev][Date Next][Subject Prev][Subject Next][ Date Index][ Subject Index]

Re: not an xy problem but Java-script who can help



"Robert Holmgren" .
 wrote:
>
> I'm not sure that I follow you. Isn't your hexadecimal number
_already_ an
> alpha $tring? It looks like one to me (FFCC99). Just prepend
the "#"
> character.
>
> If your source value isn't in form "FFCC99", then how is it
stated? As decimal
> (16764057)? Or what?
>
> -----------------------------
> Robert Holmgren
> holmgren@xxxxxxxx
> ---------------------------

========answer===refrasing the poblem====
I am writing a HTML file (using xywrite of course so there is an
connection)
, in that file I wrote a Java-scriptprogam (wich is activated by
a mouse-click.)
That script will (among other things) do:
-- open a new window
-- open a new deocument
-- and write HTML-code in that document
  (on the fly as they say)
-- close the document

now the problem:
suppose the is an variable called rrggbb:
var rrggbb= 0X00CC99 (thats hex 00CC99)

I can add to that varable, for instance ff0000 , like this:

rrggbb = rrggbb + 0XFF0000

as a result the value of rrggbb =
hexadecimal FFCC99
or decimal 16764057

now I use the javascript doument.write:

document.write (' ')

what I want javascript to do is replacing the rrggbb by
FFCC99 likeI typed it myself in the document
but instead java wil "typ" 16764057

so the result is

and thats somthing HTML doesn't understand or will see as #167640
which also is a collor but not what I ment to be


so I want the value of rrggbb reprented in hex-form
when rrggbb is displayed (writen to the document)

greetings carel