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

  • Home
  • SEARCH
  • 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 8035439
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T02:18:35+00:00 2026-06-05T02:18:35+00:00

just a quick question concerning order of processing and the way DOM’s are processed.

  • 0

just a quick question concerning order of processing and the way DOM’s are processed.

My understanding is that it is best practice to include all JQuery scripts just before the tag. In my situation, I have a div container that witholds most of my body elements. Among these elements are my footer, which has the company name and year. Currently my pages are setup in a modular fashion (header.php, page.php, footer.php) and I want to include my company name and year in the footer.php, as this would obviously allow for easy editing of the company name. My problem lies in wanting to maintain the format of keeping jquery scripts just before the body. With this layout, I cannot include the company name in my footer.php without including the jquery scripts within my div. I’ll show you what I mean with psuedocode:

How it’s currently setup:

page.php

<body>
<div class="container">
  //body elements
<hr>
 <p>&copy; Company 2012</p>
</div>
<script>
  //some javascript #1
</script>
<script>
  //some javascript #2
</script>

footer.php:

<script> //same static javascript that doesn't change page to page </script>
</body>

How I want to set it up (allows for easy site-wide changing of company name):

page.php

<body>
<div class="container">
  //body elements
<script>
  //some javascript #1
</script>
<script>
  //some javascript #2
</script>

footer.php:

<hr>
 <p>&copy; Company 2012</p>
</div>
<script> //same static javascript that doesn't change page to page </script>
</body>

I realize I can do it this way, but I am afraid of losing optimization since my jquery scripts will technically be executing within the container.

With all of this said, will including my jquery scripts before the closing div of the page’s container, but after all the contents of the div, cause it to be less efficient than if it was after said div closing?

I realize all of this entirely depends on how a DOM is processed, but I can’t seem to find any information on whether or not the DOM processes as it goes, or if it requires an ending tag before it’s actually processed, which would in turn cause the second method to be slower.

Let me know if I can clear anything up.
Thanks

  • 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-06-05T02:18:38+00:00Added an answer on June 5, 2026 at 2:18 am

    Inline scripts block the rendering of the whole page. (Only Opera does some rendering) So it doesn’t matter where you put them in your case. In general it’s better to put them at the end because external files can still be downloaded, and if flushing is enabled something can be rendered.

    External scripts only block the rendering of everything below them.

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

Sidebar

Related Questions

Just a quick question about best practice in MVC development. Let's say that I've
Just a quick question, I'm getting the idea that you don't. Why is this,
just a quick question - most tablets and devices have a touchscreen keyboard that
Just a quick question and I hope that hasn't been asked before. I want
Just a quick question, where do I put the exe that I am trying
Just a quick question. I understand that Singleton patterns can be extended and that
Just a quick question. I have an NSArray that is generated in my applicationDidFinishLaunching
Just a quick question, that I cannot fathom out, hope you guys and girls
just a quick question. First of all, let me verify that I have the
just a quick question, is there a way I can embed adevance text edit

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.