August 13, 2003, 14:18
|
#1
|
King
Local Time: 07:19
Local Date: November 2, 2010
Join Date: Jul 2002
Location: Go sneer at that cow creamer!
Posts: 1,305
|
HTML: global variables
Is there a way to store color info (like rgb and hex) as global variables in html? I'm working on this website, and it's got maybe 10 or 20 thousand tables, most with the same bg color. The last thing I want to do is go through all of them and change the colors cause of one stupid mistake (and it's more convenient than global find/replace).
__________________
cIV list: cheats
Now watch this drive!
|
|
|
|
August 13, 2003, 14:20
|
#2
|
President of the OT
Local Time: 01:19
Local Date: November 2, 2010
Join Date: Nov 1999
Location: Calgary, Alberta
Posts: 40,843
|
HTML doesn't have variables. Period.
It's a markup language, not a programming language.
What you probably want is a scripting environment of some kind (PHP could do that no problem), or CSS somehow.
__________________
"I'll never doubt you again when it comes to hockey, [Prince] Asher." - Guynemer
|
|
|
|
August 13, 2003, 14:28
|
#3
|
King
Local Time: 07:19
Local Date: November 2, 2010
Join Date: Jul 2002
Location: Go sneer at that cow creamer!
Posts: 1,305
|
For large sections, such as navbar and some text, I'm using php includes, but I was hoping there was an easier way to do it with something like css. (really wasn't clear above)
__________________
cIV list: cheats
Now watch this drive!
|
|
|
|
August 13, 2003, 14:31
|
#4
|
President of the OT
Local Time: 01:19
Local Date: November 2, 2010
Join Date: Nov 1999
Location: Calgary, Alberta
Posts: 40,843
|
If you're already using PHP, just use a PHP variable.
Then use "$color" everywhere and define it once at the top.
__________________
"I'll never doubt you again when it comes to hockey, [Prince] Asher." - Guynemer
|
|
|
|
August 13, 2003, 14:37
|
#5
|
Emperor
Local Time: 03:19
Local Date: November 2, 2010
Join Date: Jun 2000
Location: Fort LOLderdale, FL Communist Party of Apolyton
Posts: 9,091
|
You can do it with CSS. Suppose (for some reason) you want all cells in bright red. Either in the head of your document, or better, in a external css file, write:
td {background-color: #ff0000}
All table cells in linked documents wil then be red. You can override indivudual cells with by using the CLASS attribute to link another style or using an inline style:
<td align="center" width="45" style="background-color: #ffff00">
__________________
Christianity: The belief that a cosmic Jewish Zombie who was his own father can make you live forever if you symbolically eat his flesh and telepathically tell him you accept him as your master, so he can remove an evil force from your soul that is present in humanity because a rib-woman was convinced by a talking snake to eat from a magical tree...
|
|
|
|
August 13, 2003, 14:38
|
#6
|
King
Local Time: 07:19
Local Date: November 2, 2010
Join Date: Jul 2002
Location: Go sneer at that cow creamer!
Posts: 1,305
|
__________________
cIV list: cheats
Now watch this drive!
|
|
|
|
August 13, 2003, 14:42
|
#7
|
King
Local Time: 07:19
Local Date: November 2, 2010
Join Date: Jul 2002
Location: Go sneer at that cow creamer!
Posts: 1,305
|
I think I'll go with the php approach
I allready have a mile long css file, an all the tables are slightly different- don't want to go around with
Code:
|
td {blah: "" etc}
.{}
.{}
.{}
.{} |
and then have to redefine class for each table.
Lets see how this works.
__________________
cIV list: cheats
Now watch this drive!
|
|
|
|
August 13, 2003, 14:43
|
#8
|
Emperor
Local Time: 03:19
Local Date: November 2, 2010
Join Date: Jun 2000
Location: Fort LOLderdale, FL Communist Party of Apolyton
Posts: 9,091
|
You can do the same thing for any element, it doesn't have to just be TD.
Ten to twenty thousand tables. Man, and I thought my work was hard.
__________________
Christianity: The belief that a cosmic Jewish Zombie who was his own father can make you live forever if you symbolically eat his flesh and telepathically tell him you accept him as your master, so he can remove an evil force from your soul that is present in humanity because a rib-woman was convinced by a talking snake to eat from a magical tree...
|
|
|
|
August 13, 2003, 14:47
|
#9
|
King
Local Time: 07:19
Local Date: November 2, 2010
Join Date: Jul 2002
Location: Go sneer at that cow creamer!
Posts: 1,305
|
I know some css... enough to define styles
Well, maybe it's not exactly 20,000, but who's counting?
__________________
cIV list: cheats
Now watch this drive!
|
|
|
|
August 13, 2003, 14:52
|
#10
|
Emperor
Local Time: 03:19
Local Date: November 2, 2010
Join Date: Jun 2000
Location: Fort LOLderdale, FL Communist Party of Apolyton
Posts: 9,091
|
CSS is bloody simple.
http://archive.devx.com/projectcool/...mic/index.html
On the one hand, if you're more comfortable with PHP, go with it. On the other hand, you do need to keep in mind future developers. My current task is ripping out a bunch of brilliant JavaScript that no one here at the company can understand. It functions very well, but since we can't understand it (it's extremly complex and well over 1200 lines), we can't modify it. It's been around for three years, and none of the developers here was here when it was written.
__________________
Christianity: The belief that a cosmic Jewish Zombie who was his own father can make you live forever if you symbolically eat his flesh and telepathically tell him you accept him as your master, so he can remove an evil force from your soul that is present in humanity because a rib-woman was convinced by a talking snake to eat from a magical tree...
|
|
|
|
August 13, 2003, 14:55
|
#11
|
King
Local Time: 07:19
Local Date: November 2, 2010
Join Date: Jul 2002
Location: Go sneer at that cow creamer!
Posts: 1,305
|
No, no... I do know CSS... And I don't know how I've lived without it. The o'reilley book is right behind me.
__________________
cIV list: cheats
Now watch this drive!
|
|
|
|
August 13, 2003, 14:56
|
#12
|
Emperor
Local Time: 03:19
Local Date: November 2, 2010
Join Date: Jun 2000
Location: Fort LOLderdale, FL Communist Party of Apolyton
Posts: 9,091
|
Mea culpa, read too quickly.
__________________
Christianity: The belief that a cosmic Jewish Zombie who was his own father can make you live forever if you symbolically eat his flesh and telepathically tell him you accept him as your master, so he can remove an evil force from your soul that is present in humanity because a rib-woman was convinced by a talking snake to eat from a magical tree...
|
|
|
|
August 13, 2003, 14:58
|
#13
|
Emperor
Local Time: 03:19
Local Date: November 2, 2010
Join Date: Jun 2000
Location: Fort LOLderdale, FL Communist Party of Apolyton
Posts: 9,091
|
Alternatively, you could create variables using JavaScript.
Just giving you options.
__________________
Christianity: The belief that a cosmic Jewish Zombie who was his own father can make you live forever if you symbolically eat his flesh and telepathically tell him you accept him as your master, so he can remove an evil force from your soul that is present in humanity because a rib-woman was convinced by a talking snake to eat from a magical tree...
|
|
|
|
August 13, 2003, 15:07
|
#14
|
President of the OT
Local Time: 01:19
Local Date: November 2, 2010
Join Date: Nov 1999
Location: Calgary, Alberta
Posts: 40,843
|
1,200 lines of JavaScript is a challenge?
__________________
"I'll never doubt you again when it comes to hockey, [Prince] Asher." - Guynemer
|
|
|
|
August 13, 2003, 15:21
|
#15
|
Emperor
Local Time: 03:19
Local Date: November 2, 2010
Join Date: Jun 2000
Location: Fort LOLderdale, FL Communist Party of Apolyton
Posts: 9,091
|
Quote:
|
Originally posted by Asher
1,200 lines of JavaScript is a challenge?
|
I said at least. We really don't know how long it was, because it was all wrapped up into one long line. 1200 was where I got to before I was told to drop it.
Go here: http://www.acuvue.com/
Those twelve hundred+ lines of code control the buttons in the left side navbar. A couple rollovers, and a flyout menu? I could (and will) do the same with about 50 lines of code.
__________________
Christianity: The belief that a cosmic Jewish Zombie who was his own father can make you live forever if you symbolically eat his flesh and telepathically tell him you accept him as your master, so he can remove an evil force from your soul that is present in humanity because a rib-woman was convinced by a talking snake to eat from a magical tree...
|
|
|
|
August 13, 2003, 17:42
|
#16
|
King
Local Time: 03:19
Local Date: November 2, 2010
Join Date: Sep 2002
Posts: 2,681
|
Did you even do a web search on that old menu system? I just found where it came from in a few seconds.
AllWebMenus
|
|
|
|
August 13, 2003, 17:51
|
#17
|
King
Local Time: 07:19
Local Date: November 2, 2010
Join Date: Jul 2002
Location: Go sneer at that cow creamer!
Posts: 1,305
|
WTF????? Crazy menu! Run!
I'm using the menu system from milonic.com/menu... super easy.
Free, or $40 for a corporation.
__________________
cIV list: cheats
Now watch this drive!
|
|
|
|
August 14, 2003, 03:45
|
#18
|
Deity
Local Time: 15:19
Local Date: November 2, 2010
Join Date: May 1999
Location: The City State of Noosphere, CPA special envoy
Posts: 14,606
|
Re: HTML: global variables
Quote:
|
Originally posted by MattH
Is there a way to store color info (like rgb and hex) as global variables in html? I'm working on this website, and it's got maybe 10 or 20 thousand tables, most with the same bg color.
|
Isn't doing website layout with tables a bit behind the times?
__________________
(\__/) 07/07/1937 - Never forget
(='.'=) "Claims demand evidence; extraordinary claims demand extraordinary evidence." -- Carl Sagan
(")_(") "Starting the fire from within."
|
|
|
|
August 14, 2003, 09:28
|
#19
|
King
Local Time: 07:19
Local Date: November 2, 2010
Join Date: Jul 2002
Location: Go sneer at that cow creamer!
Posts: 1,305
|
Re: Re: HTML: global variables
Quote:
|
Originally posted by Urban Ranger
Isn't doing website layout with tables a bit behind the times?
|
I'll forgive you
Don't see what's wrong with them, they don't look as dorky as most.
__________________
cIV list: cheats
Now watch this drive!
|
|
|
|
August 14, 2003, 10:19
|
#20
|
Emperor
Local Time: 03:19
Local Date: November 2, 2010
Join Date: Jun 2000
Location: Fort LOLderdale, FL Communist Party of Apolyton
Posts: 9,091
|
Re: Re: HTML: global variables
Quote:
|
Originally posted by Urban Ranger
Isn't doing website layout with tables a bit behind the times?
|
That's what I tell them every week. I've even given my boss the interview from DevNet with the PL from ESPN on why they went to an all CSS design. I've got their attention.
Here's the problem, our buyers (eye doctors) buy many thousands of dollars worth of product at a time. Regular folks have to buy them from eye doctors, so our technical requirements mean we need to support even the 2% of 1% (.0002) of users who still access our site with Netscape Nav 4 for Mac (which doesn't support layers or CSS). If those 5,000 people buy $1,000 worth of product, well, that's a half million dollars.
Of course, we need to break the numbers down further, and find out how many of those people are access the professional side of the site.
But whereas they would reject my arguments quickly before, they are now listening, especially after I showed them the ESPN site and how they were handling old users. Plus I mentioned we can migrate slowly and prepare people for the change ahead of time.
__________________
Christianity: The belief that a cosmic Jewish Zombie who was his own father can make you live forever if you symbolically eat his flesh and telepathically tell him you accept him as your master, so he can remove an evil force from your soul that is present in humanity because a rib-woman was convinced by a talking snake to eat from a magical tree...
|
|
|
|
August 14, 2003, 10:25
|
#21
|
Emperor
Local Time: 03:19
Local Date: November 2, 2010
Join Date: Jun 2000
Location: Fort LOLderdale, FL Communist Party of Apolyton
Posts: 9,091
|
Quote:
|
Originally posted by dejon
Did you even do a web search on that old menu system? I just found where it came from in a few seconds.
AllWebMenus
|
And what, I'm just supposed to convince my bosses to purchase this program because the design firm that created this site two+ years ago had a copy? It swats flies with a sledgehammer and we've been looking for a reason to get rid of it. I can replicate the same functionality with much less effort.
And yes, I googled the name of the product. I've been writing mouseOvers for seven years, and this is the most useless product I've ever seen.
__________________
Christianity: The belief that a cosmic Jewish Zombie who was his own father can make you live forever if you symbolically eat his flesh and telepathically tell him you accept him as your master, so he can remove an evil force from your soul that is present in humanity because a rib-woman was convinced by a talking snake to eat from a magical tree...
|
|
|
|
August 14, 2003, 10:36
|
#22
|
Deity
Local Time: 15:19
Local Date: November 2, 2010
Join Date: May 1999
Location: The City State of Noosphere, CPA special envoy
Posts: 14,606
|
Re: Re: Re: HTML: global variables
Quote:
|
Originally posted by MattH
I'll forgive you
Don't see what's wrong with them, they don't look as dorky as most.
|
I have been doing websites since 1996, when there weren't any WYSIWYG editors, CSS wasn't conceived, and HTML 3.2 was the best thing there was. So I think I know a few things about websites here and there
There are a few problems with tables.
1. Browsers don't render them the same way, particularly nested tables, which is something you will have to use if you do layouts with tables.
2. Complicated tables are rendered slowly.
3. They are hell to edit.
In the bad old days when there was nothing else, one gotta do what one gotta do. But why use them for layout now?
__________________
(\__/) 07/07/1937 - Never forget
(='.'=) "Claims demand evidence; extraordinary claims demand extraordinary evidence." -- Carl Sagan
(")_(") "Starting the fire from within."
|
|
|
|
August 14, 2003, 10:39
|
#23
|
Deity
Local Time: 15:19
Local Date: November 2, 2010
Join Date: May 1999
Location: The City State of Noosphere, CPA special envoy
Posts: 14,606
|
Re: Re: Re: HTML: global variables
Quote:
|
Originally posted by chegitz guevara
Here's the problem, our buyers (eye doctors) buy many thousands of dollars worth of product at a time. Regular folks have to buy them from eye doctors, so our technical requirements mean we need to support even the 2% of 1% (.0002) of users who still access our site with Netscape Nav 4 for Mac (which doesn't support layers or CSS). If those 5,000 people buy $1,000 worth of product, well, that's a half million dollars.
|
That would be a problem.
Quote:
|
Originally posted by chegitz guevara
But whereas they would reject my arguments quickly before, they are now listening, especially after I showed them the ESPN site and how they were handling old users. Plus I mentioned we can migrate slowly and prepare people for the change ahead of time.
|
Excellent, at least you are getting somewhere.
__________________
(\__/) 07/07/1937 - Never forget
(='.'=) "Claims demand evidence; extraordinary claims demand extraordinary evidence." -- Carl Sagan
(")_(") "Starting the fire from within."
|
|
|
|
August 14, 2003, 10:48
|
#24
|
Emperor
Local Time: 03:19
Local Date: November 2, 2010
Join Date: Jun 2000
Location: Fort LOLderdale, FL Communist Party of Apolyton
Posts: 9,091
|
Re: Re: Re: Re: HTML: global variables
Quote:
|
Originally posted by Urban Ranger
That would be a problem.
|
If it were a small number of users, I was prepared to go out to their places and upgrade the browser for them for free, just so I could get rid of this issue.
One thing at a time. First I'm getting all our sites WCAG Priority 1 compliant. I'm working on Taiwan right now and will be moving on to Hong Kong soon. Working in a language you don't know is hard. Working in another alphabet is damn near impossible. And then the Taiwanese have to go and use tradiational Chinese while Hong Kong uses simplified (so I can't just copy the modifications to one country to another). You'd think being a former Brit colony English would be more prevalent there. Ah well, right now it's the East Asians keeping me employed so I won't complain too loudly.
__________________
Christianity: The belief that a cosmic Jewish Zombie who was his own father can make you live forever if you symbolically eat his flesh and telepathically tell him you accept him as your master, so he can remove an evil force from your soul that is present in humanity because a rib-woman was convinced by a talking snake to eat from a magical tree...
|
|
|
|
August 14, 2003, 10:54
|
#25
|
Deity
Local Time: 15:19
Local Date: November 2, 2010
Join Date: May 1999
Location: The City State of Noosphere, CPA special envoy
Posts: 14,606
|
Re: Re: Re: Re: Re: HTML: global variables
Quote:
|
Originally posted by chegitz guevara
And then the Taiwanese have to go and use tradiational Chinese while Hong Kong uses simplified (so I can't just copy the modifications to one country to another). You'd think being a former Brit colony English would be more prevalent there.
|
Hm, no. You could have asked me. Both Hong Kong and Taiwan use the traditional Chinese characters. In fact, most Hong Kong people cannot read simplified Chinese [yeah, yeah, I know]. We also use English, yes, but 95% (at least) of the population sucks in English. Even English teachers fail qualifying exams
What is "WCAG Priority 1 compliant?"
__________________
(\__/) 07/07/1937 - Never forget
(='.'=) "Claims demand evidence; extraordinary claims demand extraordinary evidence." -- Carl Sagan
(")_(") "Starting the fire from within."
|
|
|
|
August 14, 2003, 11:03
|
#26
|
Emperor
Local Time: 03:19
Local Date: November 2, 2010
Join Date: Jun 2000
Location: Fort LOLderdale, FL Communist Party of Apolyton
Posts: 9,091
|
Re: Re: Re: Re: Re: Re: HTML: global variables
Quote:
|
Originally posted by Urban Ranger
Hm, no. You could have asked me. Both Hong Kong and Taiwan use the traditional Chinese characters. In fact, most Hong Kong people cannot read simplified Chinese [yeah, yeah, I know]. We also use English, yes, but 95% (at least) of the population sucks in English. Even English teachers fail qualifying exams
|
Really? They want me to use simplified. I considered asking you, but I felt it was unprofessional to have you help when I couldn't bill for your time. Plus, it's up to the Hong Kong department to tell me what to use. I will, however, ask for clarification.
Quote:
|
What is "WCAG Priority 1 compliant?"
|
Do you know what US 508 regulations are? Almost the same thing. Make sure all images have appropriate alt-text, that all information can be accessed by any users, by they blind, deaf, motor impared or even congnatively disabled (the last one is toughest cuz it means butting heads with marketting and trying to get them to use simpler language).
__________________
Christianity: The belief that a cosmic Jewish Zombie who was his own father can make you live forever if you symbolically eat his flesh and telepathically tell him you accept him as your master, so he can remove an evil force from your soul that is present in humanity because a rib-woman was convinced by a talking snake to eat from a magical tree...
|
|
|
|
August 14, 2003, 11:23
|
#27
|
King
Local Time: 03:19
Local Date: November 2, 2010
Join Date: Sep 2002
Posts: 2,681
|
Quote:
|
Originally posted by chegitz guevara
And what, I'm just supposed to convince my bosses to purchase this program because the design firm that created this site two+ years ago had a copy? It swats flies with a sledgehammer and we've been looking for a reason to get rid of it. I can replicate the same functionality with much less effort.
And yes, I googled the name of the product. I've been writing mouseOvers for seven years, and this is the most useless product I've ever seen.
|
Indeed, for your needs it looks like quite a bit of excessive functionality and overhead. I would replace it too.
I only pointed it out because your prior posts seemed to indicate a lack of knowledge about the menu system or how it works - when the makers of it were easily discoverable, and should have documentation on it. (Maybe next time I won't try to help. )
|
|
|
|
August 14, 2003, 11:41
|
#28
|
Deity
Local Time: 15:19
Local Date: November 2, 2010
Join Date: May 1999
Location: The City State of Noosphere, CPA special envoy
Posts: 14,606
|
Re: Re: Re: Re: Re: Re: Re: HTML: global variables
Quote:
|
Originally posted by chegitz guevara
Really? They want me to use simplified.
|
What? What utter boobs! The only reason if they do that is they want to do the website for Mainland China.
Quote:
|
Originally posted by chegitz guevara
I considered asking you, but I felt it was unprofessional to have you help when I couldn't bill for your time.
|
Pah. Lots of people asked tech questions and those who answered never got paid anyway.
Quote:
|
Originally posted by chegitz guevara
Plus, it's up to the Hong Kong department to tell me what to use. I will, however, ask for clarification.
|
This is a Hong Kong government website. Press the "Chinese" button (red button with yellow characters, top left), and see for yourself whether that is traditional or simplified Chinese. I hope you can tell
Quote:
|
Originally posted by chegitz guevara
Do you know what US 508 regulations are? Almost the same thing. Make sure all images have appropriate alt-text, that all information can be accessed by any users, by they blind, deaf, motor impared or even congnatively disabled (the last one is toughest cuz it means butting heads with marketting and trying to get them to use simpler language).
|
Oh that. Looks reasonable, though one wonders how many blind people (deaf people aren't really impaired here) surf websites. So far, I have seen only one, who happens to be the head of the local Oxfam.
__________________
(\__/) 07/07/1937 - Never forget
(='.'=) "Claims demand evidence; extraordinary claims demand extraordinary evidence." -- Carl Sagan
(")_(") "Starting the fire from within."
|
|
|
|
August 14, 2003, 14:33
|
#29
|
Emperor
Local Time: 03:19
Local Date: November 2, 2010
Join Date: Jun 2000
Location: Fort LOLderdale, FL Communist Party of Apolyton
Posts: 9,091
|
Re: Re: Re: Re: Re: Re: Re: Re: HTML: global variables
Quote:
|
Originally posted by Urban Ranger
Oh that. Looks reasonable, though one wonders how many blind people (deaf people aren't really impaired here) surf websites. So far, I have seen only one, who happens to be the head of the local Oxfam.
|
The real question you should be asking yourself is how many blind people need contact lenses?
Seriously, though, all of Johnson & Johnson's websites need to be accessible, so despite the fact that it doesn't seem to make sense at first glance . . . on top of that, most contact lens users do have some sort of vision problem. There are actually good reasons to do it, but it's time for me to leave.
__________________
Christianity: The belief that a cosmic Jewish Zombie who was his own father can make you live forever if you symbolically eat his flesh and telepathically tell him you accept him as your master, so he can remove an evil force from your soul that is present in humanity because a rib-woman was convinced by a talking snake to eat from a magical tree...
|
|
|
|
August 15, 2003, 00:47
|
#30
|
Deity
Local Time: 15:19
Local Date: November 2, 2010
Join Date: May 1999
Location: The City State of Noosphere, CPA special envoy
Posts: 14,606
|
Got a better offer already?
__________________
(\__/) 07/07/1937 - Never forget
(='.'=) "Claims demand evidence; extraordinary claims demand extraordinary evidence." -- Carl Sagan
(")_(") "Starting the fire from within."
|
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is On
|
|
|
All times are GMT -4. The time now is 03:19.
|
|