Beginner HTML Question

K

Kurt R. Todoroff

I purchased the Macromedia Studio MX 2004 suite a month ago, and have been
teaching HTML to myself. (I've previously programmed in ALGOL, FORTRAN, BASIC.
I've dabled around in C, C++, and PASCAL. I've been using LaTeX regularly for
ten years and consider myself well above average, approaching expert.) I've
learned quite a bit about HTML in one month, and have become quite comfortable
with it. I have a question that I haven't been able to find the answer to in
several sources.

I want to include the text "90 years" in eight different locations in my site.
Next year I'll need to change all occurrences of "90" to "91". Rather than
search and replace all of the "90" occurrences, can I define a command, say
"&age;", at the beginning of the document, set it's value to 90, and then
include the text "&age; years" in the eight locations? Next year, I'll only
have to change the one value of "&age;" to 91, and then this will be reflected
throughout all eight occurences in the document. If this is possible, how can
I use "&age;" in other documents within the same site? Can I include this
command definition in the css?

Thank you.



Kurt Todoroff
(e-mail address removed)

Markets, not mandates and mob rule.
Consent, not compulsion.
 
T

Toby Inkster

Kurt said:
I want to include the text "90 years" in eight different locations in my site.
Next year I'll need to change all occurrences of "90" to "91". Rather than
search and replace all of the "90" occurrences, can I define a command, say
"&age;", at the beginning of the document, set it's value to 90, and then
include the text "&age; years" in the eight locations?

Theoretically, yes.

Number of browser that support it: 0.

Use search and replace. Of if you really don't want to do that, a
server-side include.
 
S

Spartanicus

I purchased the Macromedia Studio MX 2004 suite a month ago, and have been
teaching HTML to myself. (I've previously programmed in ALGOL, FORTRAN, BASIC.
I've dabled around in C, C++, and PASCAL. I've been using LaTeX regularly for
ten years and consider myself well above average, approaching expert.) I've
learned quite a bit about HTML in one month, and have become quite comfortable
with it.

Another thing to learn: HTML is a markup language, not a programming
language.
I want to include the text "90 years" in eight different locations in my site.
Next year I'll need to change all occurrences of "90" to "91". Rather than
search and replace all of the "90" occurrences, can I define a command, say
"&age;", at the beginning of the document, set it's value to 90, and then
include the text "&age; years" in the eight locations? Next year, I'll only
have to change the one value of "&age;" to 91, and then this will be reflected
throughout all eight occurences in the document. If this is possible, how can
I use "&age;" in other documents within the same site? Can I include this
command definition in the css?

CSS is for presentation only, entirely optional and thus not to be used
for content.
 
D

Dan Abrey

Kurt R. Todoroff said:
I purchased the Macromedia Studio MX 2004 suite a month ago, and have been
teaching HTML to myself. (I've previously programmed in ALGOL, FORTRAN, BASIC.
I've dabled around in C, C++, and PASCAL. I've been using LaTeX regularly for
ten years and consider myself well above average, approaching expert.) I've
learned quite a bit about HTML in one month, and have become quite comfortable
with it. I have a question that I haven't been able to find the answer to in
several sources.

I want to include the text "90 years" in eight different locations in my site.
Next year I'll need to change all occurrences of "90" to "91". Rather than
search and replace all of the "90" occurrences, can I define a command, say
"&age;", at the beginning of the document, set it's value to 90, and then
include the text "&age; years" in the eight locations? Next year, I'll only
have to change the one value of "&age;" to 91, and then this will be reflected
throughout all eight occurences in the document. If this is possible, how can
I use "&age;" in other documents within the same site? Can I include this
command definition in the css?

Thank you.

If you are willing to diverse from HTML to solve the problem, a better
option is using JavaScript.

Include the following in the <head> tags:

<script language="javascript">
age = 90;
</script>

And then whenever referring to the variable:

<script language="JavaScript">
document.write(age + " years");
</script>
 
U

Uncle Pirate

Dan said:
If you are willing to diverse from HTML to solve the problem, a better
option is using JavaScript.

Not a better option because the OP seems to be talking about content.
Javascript should never be used for content; too many people have it off
and will miss the content supplied by javascript. I wouldn't see a
thing with the method you suggest.

--
Stan McCann "Uncle Pirate"
Webmaster/Computer Center Manager, NMSU at Alamogordo
Cooordinator, Tularosa Basin Chapter, ABATE of NM AMA#758681
'94 1500 Vulcan (now wrecked) :( http://motorcyclefun.org/Dcp_2068c.jpg
A zest for living must include a willingness to die. - R.A. Heinlein
 
S

Sam Hughes

:
Another thing to learn: HTML is a markup language, not a programming
language.

Another thing to learn: What he did ask for _was_ theoretically
possible with HTML. (Says the person who only recently learned this
silly trivium.)
 
S

Sam Hughes

(e-mail address removed) (Kurt R. Todoroff) wrote in
I purchased the Macromedia Studio MX 2004 suite a month ago, and
have been teaching HTML to myself. (I've previously programmed in
ALGOL, FORTRAN, BASIC.
I've dabled around in C, C++, and PASCAL. I've been using LaTeX
regularly for
ten years and consider myself well above average, approaching
expert.) I've learned quite a bit about HTML in one month, and have
become quite comfortable with it. I have a question that I haven't
been able to find the answer to in several sources.

I want to include the text "90 years" in eight different locations
in my site.

Several text editors (such as Crimson Editor, free) allow you to do
"find in files." UltraEdit allows Replace in Files, too.

You can also use a server-side include. Can't do it with HTML, except
for some obscure theoretical thing that zero _browsers_ understand and
only several user-agents understand, such as the W3C HTML validator,
and I suppose probably the WDG version too.
(<http://www.htmlhelp.com/tools/validator/>)
 
S

Sam Hughes

Another thing to learn: What he did ask for _was_ theoretically
possible with HTML. (Says the person who only recently learned this
silly trivium.)

Oh and my post had no actual point. The other poster did indeed need to
know that HTML is not a programming language, in a sense.
 
N

nice.guy.nige

While the city slept, Dan Abrey ([email protected]) feverishly typed...
Include the following in the <head> tags:

<script language="javascript">
age = 90;
</script>

And this would help the OP how exactly??? Instead of replacing "90" in the
HTML for each file, he now needs to replace it in the javascript for each
file! Your post would have made more sense if you had suggested storing the
javascript in a separate file and loading that in each HTML file, but then
you have the problem of using a client-side scripting language to deliver
content.

A much better idea would be for the OP to use some kind of server-side
language, or SSI. Also, as he's spent all that money (presumably!) on
Macromedia Studio, he could set up that text as a library item, then change
it in Dreamweaver.

Cheers,
Nige
 
S

SpaceGirl

Uncle Pirate wrote:

Javascript should never be used for content; too many people have it off
and will miss the content supplied by javascript.

Nooo it should be used for pretty floaty things and mouse trails and
putting something nice in that nasty empty status bar thing... ooh and
popup windows, and all that nice stuff :)

And only silly ppl have JS turned off!!!

--


x theSpaceGirl (miranda)

# lead designer @ http://www.dhnewmedia.com #
# remove NO SPAM to email, or use form on website #
 
N

Neal

Uncle Pirate wrote:



Nooo it should be used for pretty floaty things and mouse trails and
putting something nice in that nasty empty status bar thing... ooh and
popup windows, and all that nice stuff :)

And only silly ppl have JS turned off!!!

And navigation. If you don't use dropdown Js for navigation, nobody will
like you and you won't be cool. ;)
 
S

SpaceGirl

Neal said:
And navigation. If you don't use dropdown Js for navigation, nobody will
like you and you won't be cool. ;)

Yes! And those nice page transitions that only work in IE! Those are so
awesom!

--


x theSpaceGirl (miranda)

# lead designer @ http://www.dhnewmedia.com #
# remove NO SPAM to email, or use form on website #
 
D

Dylan Parry

Spake Karl Groves unto thee:
Guess you've never run into that on your "fan" sites.

Erm... Miranda was being _sarcastic_ when she said that only silly people
have it turned off, which was fairly obvious from the rest of the post
that you conveniently snipped.
 
K

Karl Groves

Dylan Parry said:
Spake Karl Groves unto thee:


Erm... Miranda was being _sarcastic_ when she said that only silly people
have it turned off, which was fairly obvious from the rest of the post
that you conveniently snipped.

Stay out of this, you. I'm trying to start an argument.

-Karl
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top