Adding code to every existing web page

T

Tim

Hi,
Is there a way to add a line of code tp every web page, taking into account
it's heirerarchial location in relation to the file?

For example, I need to add a JavaScript include on every page. I thought of
using "Find & Replace" to insert it, but this wont allow for adding the "../"
infront of the code for the relative location. And I don't want to hard code
the script location so that it looks to the http address.

Any thoughts?
 
R

Ronx

The easiest way to do this is to use absolute or root relative links:
Absolute - http://www.example.com/path/file.ext (which you say you wish
to avoid)
Root relative - /path/file.ext (note the leading /)

The root relative link will always fail on disc based webs (unless the
webs root folder is the hard discs root folder - not a good situation).
 
T

Tim

Thanks Ron,

Not the answer I wanted but at least now I can stop pulling my hair out
trying to figure why it doesn't work.

Tim
 
P

P@tty Ayers

Tim said:
Hi,
Is there a way to add a line of code tp every web page, taking into
account
it's heirerarchial location in relation to the file?

For example, I need to add a JavaScript include on every page. I thought
of
using "Find & Replace" to insert it, but this wont allow for adding the
"../"
infront of the code for the relative location. And I don't want to hard
code
the script location so that it looks to the http address.

Any thoughts?

How many levels of hierarchy are there? Can you do several separate Find &
Replace operations, inserting the correct code into the folders on each
level?


--
Patty Ayers | Adobe Community Expert
www.WebDevBiz.com
Free Articles on the Business of Web Development
Web Design Contract, Estimate Request Form, Estimate Worksheet
--
 

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

Top