Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HTML Constant? eg: $HOME="C:/home101"

Status
Not open for further replies.

milton747

Programmer
Apr 21, 2005
133
US
Hi,
Simple I hope.

Is there a way to define a constant in an HTML file then use it throughout. (So I don't have to do a group replace)
eg:
<head>
HOME="C:/home101"
</head>
<body>
<H1>$HOME</H1>
Will display C:/home101.

(Could Javascript do the job somehow?)

Thanks
Milt.
 

HTML - No.

Javascript - Yes. But in general it is inadvisable to use JS for anything vital to your page - it should only be used for visual enhancement, with a graceful fallback for users with JS disabled (around 8% of my typical visitors), those using text only browsers (like visually handicapped), and search engines.

If you want to pursue the JS route try forum216

If you want the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
 
Hi

Maybe the closest to what you want is SSI ( Server Side Includes ). Is not a whole new language to learn, is just a way to ask the web server to do some processing to your documents before delivering.
Code:
<head>
<!--#set var="HOME" value="C:/home101" -->
</head>
<body>
<H1><!--#echo var="HOME" --></H1>
As SSI implementation may vary, ask for more in your web server's forum. ( See the list of web server forums on Tek-Tips. )

Feherke.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top