W3C home > Mailing lists > Public > whatwg@whatwg.org > July 2015

Re: [whatwg] Site-Wide Heading Element

From: Elliott Sprehn <esprehn@chromium.org>
Date: Mon, 6 Jul 2015 16:25:55 -0700
Message-ID: <CAO9Q3iKoix2ZQSfhuXFm-1QOKKtdzSae4W_JGUVy+hfQYXK1VA@mail.gmail.com>
To: Barry Smith <bearzteez@live.com>
Cc: WHAT Working Group <whatwg@whatwg.org>, Jonathan Zuckerman <j.zuckerman@gmail.com>, Mark Simon <mark@manngo.net>
On Wed, Jun 24, 2015 at 3:30 PM, Barry Smith <bearzteez@live.com> wrote:

> ...
>>>
>>>
> When I build a website that is to have more than one page, and I want the
> "banner" to be the same across all pages,  I use the <header> element with
> a
> javascript file embedded inside, like this:
>
> <header id="banner">
>    <script src="scripts/header.js" type="text/javascript"></script>
> </header>
>
> and the javascript file looks like this:
>
> document.write('\
>    <hgroup class="myHeader">\
>        <h1>The Site Name</h1>\
>        <h2>Site Tagline</h2>\
>    </hgroup>\
> ');
>
> This way the <h1> element is still free to use as the main body heading in
> the document itself.
>
>
Please don't use document.write like this, do a server side include instead.

- E
Received on Monday, 6 July 2015 23:27:05 UTC

This archive was generated by hypermail 2.3.1 : Monday, 6 July 2015 23:27:06 UTC