Forum Moderators: open

Message Too Old, No Replies

Homesite color codes

are these quirks showing me errors?

         

tedster

4:59 pm on May 15, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm getting very fond of Homestie v.5 now, but I'm noticing somethings I don't understand about the color coding of the HTML, CSS and JS.

1. When I create a stylesheet with a declaration like margin-top:1em, the "e" in "em" is coded the same color as the "1". This doesn't happen with "px". Anyone know what's happening there?

2. Inside a javascript document.write statement, the word "this" is always shown in bold, even though it's just text to be written. I assume it's because the word "this" has a special function in Javascript.

Should I be escaping any occurances of "this" in a document.write? It doesn't seem to work very well if I do.

Filipe

5:27 pm on May 15, 2002 (gmt 0)

10+ Year Member



A1. That is because it is a little bug that's still seeing "1e" as part of a Hexadecimal color code (e.g., 1e1e1e would be a shade of grey). Nothing to worry about.

A2. This will only happen when you use single quotes in a document.write statement. If you use double quotes, Homesite recognizes it as a string and won't bold this or other commonly bolded keywords like write. Apparently it doesn't recognize things inbetween single quotes as strings (you can tell because it doesn't italicize the string).

Should I be escaping any occurances of "this" in a document.write?

By no means, it's just an IDE problem - nothing wrong with your code - though it might be clearer to you as a programmer if you started using double-quotes.

tedster

3:39 am on May 16, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks Filipe, you've eased my mind - makes perfect sense now.