By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,636 Members | 1,213 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,636 IT Pros & Developers. It's quick & easy.

How to ease the modification of header part of many pages

P: n/a
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?
Jul 25 '08 #1
Share this Question
Share on Google+
4 Replies


P: n/a
gleery wrote:
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,

--
Bart
Jul 25 '08 #2

P: n/a
On Jul 25, 4:39*pm, Bart Van der Donck <b...@nijlen.comwrote:
gleery wrote:
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,

--
*Bart
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.
Jul 25 '08 #3

P: n/a
On Jul 25, 9:19*am, gleery wrote:
* 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.
Jul 25 '08 #4

P: n/a
In comp.lang.javascript message <bdcd12f4-6061-4420-8abd-03129cee3746@z1
1g2000prl.googlegroups.com>, Fri, 25 Jul 2008 01:19:41, gleery
<jo*****@gmail.composted:
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 news:microsoft.*
hierarchy.

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

--
(c) John Stockton, nr London UK. ?@merlyn.demon.co.uk IE7 FF2 Op9 Sf3
news:comp.lang.javascript FAQ <URL:http://www.jibbering.com/faq/index.html>.
<URL:http://www.merlyn.demon.co.uk/js-index.htmjscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/TP/BP/Delphi/jscr/&c, FAQ items, links.
Jul 25 '08 #5

This discussion thread is closed

Replies have been disabled for this discussion.