How to ease the modification of header part of many pages

G

gleery

It's often for many pages to share a head part, and if we need to
modify the head part, we need to do the same to all other pages. So I
wonder if there exists a way to make it easier.
How about take the header out and request in ajax way?
 
B

Bart Van der Donck

gleery said:
It's often for many pages to share a head part, and if we need to
modify the head part, we need to do the same to all other pages. So
I wonder if there exists a way to make it easier.
How about take the header out and request in ajax way?

I'm using the following command-line instruction (replaces 'header1'
by 'header2' in all .htm-files in the current directory):

perl -pi -e 's/header1/header2/g' *.htm

Hope this helps,
 
G

gleery

I'm using the following command-line instruction (replaces 'header1'
by 'header2' in all .htm-files in the current directory):

  perl -pi -e 's/header1/header2/g' *.htm

Hope this helps,

Hi Bart:
We can do this if you need to do some replacement jobs, but in other
cases we can't write a regex to do our jobs.
Maybe a customized deploy tool can help, write a program or a shell
script to replace some regions in pages with the latest version.
 
H

Henry

  It's often for many pages to share a head part, and if we need to
modify the head part, we need to do the same to all other pages. So I
wonder if there exists a way to make it easier.

In the absence of server-side support (or to avoid the processing
overhead while serving); pre-processing. With server support; any
server side technology with includes, starting at SSI and including
pretty much every sever side technology in existence. (Server-side
includes and pre-processing would probably be off topic for this group
(with the possible exceptions of systems that were scripted/scriptable
with javascript).)
  How about take the header out and request in ajax way?

Possible, but easily the worst alternative.
 
D

Dr J R Stockton

In comp.lang.javascript message <bdcd12f4-6061-4420-8abd-03129cee3746@z1
1g2000prl.googlegroups.com>, Fri, 25 Jul 2008 01:19:41, gleery
It's often for many pages to share a head part, and if we need to
modify the head part, we need to do the same to all other pages. So I
wonder if there exists a way to make it easier.
How about take the header out and request in ajax way?

What's in the head part?

If there is JavaScript, then look into using Include Files : <URL:http:/
/www.merlyn.demon.co.uk/js-nclds.htm>.

There are many command-line tools which, individually or in conjunction,
and driven by a batch file or similar, can easily do it.

A high-level language program can easily enough be written to do it; in
fact, you could use JavaScript itself running under WSH, if you use
windows. For that you might do better to ask in the hierarchy.

It's a good idea to read the newsgroup c.l.j and its FAQ. See below.
 

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,777
Messages
2,569,604
Members
45,227
Latest member
Daniella65

Latest Threads

Top