Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6626937
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:57:14+00:00 2026-05-25T21:57:14+00:00

NOTE: I am in no way advocating multiple heads within a page I’m using

  • 0

NOTE: I am in no way advocating multiple heads within a page


I’m using Apache Tiles and I have a few tiles that include their own heads. The result of the Tiles renders into an HTML page with multiple heads.

My questions:

  1. How is the resulting page handled in IE and Chrome? [It renders and appears successful]
  2. WITH APACHE TILES What is the best practice for dealing with/avoiding multiple heads [for CSS/Javascript] without having to demand all pages use the same JS and CSS files.

For Example with Question Two:
Lets say you have the following pages: home, profile, and gallery listing. Gallery listing has fancy JQuery+YUI+… and more styles. For most users, they would only be interested in the home and profile pages, so why slow them down with loading the JS and CSS files associated with Gallery.

This is what is generated

<html>
    <head>
       <title>The Template's Title</title>
    </head>
    <body>
       <head> <script src="javascriptfile.js"/></head> Tile One Content
       <head> <script src="javascriptfile2.js"/></head> Title Two Content
    </body>
</html>

The generated contents is running the script in javascriptfile.js, and javascriptfile2. What I’m asking in the first question: is the extra heads ignored, and the contents considers? are they combined into the html/head level? Is it possible to include CSS files in the second or later head? Will this create an error with a stricter DTD?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T21:57:15+00:00Added an answer on May 25, 2026 at 9:57 pm

    Well, in modern Chrome, it’s at least possible to know what happens. Chrome uses the HTML5 parser algorithm which describes exactly how invalid mark-up is processed. The gory details are at http://dev.w3.org/html5/spec/tree-construction.html#parsing-main-inbody

    What happens in your example is that the first <head> in <body> is discarded. Then the <script src="javascriptfile.js"/> tag is processed, which is a start tag, not a self-closing tag, so everything that follows, including everything that looks like a tag, becomes a text child of the script element. Nothing is displayed and no script is run. If <script src="javascriptfile.js"/> is replaced by <script src="javascriptfile.js"></script>, and ditto for <script src="javascriptfile2.js"/>, the head start and end tags are silent discarded, and the script elements are not moved. “Tile One Content Title Two Content” is displayed and the scripts are run. The DTD makes no difference at all.

    IE is somewhat trickier to know, as before IE10, it doesn’t use the HTML5 parser algorithm and therefore it’s exact behaviour is a mystery. However, a cursory experiment appears to show that it has the same behaviour as described above.

    Although some legacy browsers move elements that can only appear in the head – such as <link> – into the head, other browsers do not, and no such behaviour can be relied upon.

    All in all, best steer well clear of such constructs.

    I don’t know about practices for Apache Tiles.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a large XML note with many nodes. is there a way that
Note that I don't have a problem and I'm not looking for another way
Some Background I have been using Git for a while now. The projects that
Note that the order can go either way (erase first then push back, just
What is the best way of extracting the values from vvv.www.xxx.yyy.zzz Note that vvv
Is this a valid way to refresh part of webpage: $(#content).load(location.href+ #content>*,); Note that
NOTE I am supporting the idea that the below issue is way impossible to
Please note - I am not looking for the right way to open/read a
NOTE: I am not set on using VI, it is just the first thing
Note that I am not asking which to choose (MVC or MVP), but rather

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.