On Jul 8, 2005, at 1:37 AM, Chris Taylor wrote:
I've been using the dash and period in ID names a lot recently
(part of
an unobtrusive DOM scripting set of functions I've been developing)
and
not found any problems yet in any of the Win browsers. Whether IDs
formatted like this "functionName.-fe-4r-6s-ef-s5-ef.2000" will
work in
older browsers or different operating systems I'm kind of crossing my
fingers about!
By "not found any problems" I assume you mean that these IDs are only
referenced by your script, and not the CSS. JS only requires that IDs
are strings. Trying to assign styles to your elements via CSS would
be problematic, since each period would be interpreted as a class
name indicator, and your middle classname starts with a hyphen (an
illegal start). But if you are only accessing the info via JS, then
it should be fine.
Richard Czeiger wrote:
Does that mean the best way to go fro ID, Class Names, Variables,
etc... is interCaps (also known as CamelCase or lowerCamelCase) ?
Some people believe so. I do. The problem that you'll run into is
that IDs and class names are case sensitive with an XHTML doctype
(and always case sensitive when accessed via the DOM), and so using
compound words can result in particularly difficult bugs to find
(e.g., what that backGroundDIV or BackGroundDiv or backgroundDiv
or...?). Best to avoid compound words, I think (e.g., replace with
bgContent).
--
Ben Curtis : webwright
bivia : a personal web studio
http://www.bivia.com
v: (818) 507-6613
******************************************************
The discussion list for http://webstandardsgroup.org/
See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list & getting help
******************************************************