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 8370717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T13:58:49+00:00 2026-06-09T13:58:49+00:00

I am using this web design app, and for some reason it puts the

  • 0

I am using this web design app, and for some reason it puts the JS (look below) in between the <body> tags and not in the head tags.

So is there any way to get this code into the HEAD tags using some form of JS?

<script type="text/javascript">
  $(document).ready(function(){
    $('body').rollbar({zIndex:100});
  });
</script>

The reason for this is, I want the jQuery plugin to apply to the ‘body’ div, but it doesn’t work if it’s in the BODY tags – but it does when it’s in the HEAD tags.
If there is anyway to dynamically move the code from the body tags to the HEAD tags that would be awesome. I’ve been wanting to know how/and if that’s possible for a while now

Look forward to the responses!

  • 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-09T13:58:51+00:00Added an answer on June 9, 2026 at 1:58 pm

    This code:

    <script type="text/javascript">
      $(document).ready(function(){
        $('body').rollbar({zIndex:100});
      });
    </script>
    

    will work identically whether it’s in the HEAD section or the BODY section as long as jQuery is loaded before it. That’s because the $(document).ready causes the $('body').rollbar({zIndex:100}); not to execute until after the document is loaded which will be the same time no matter where the original code was loaded from.

    If you are seeing a difference in behavior when you move it, then something else is causing that difference that you have not disclosed because simply moving this code to the HEAD section will not cause a difference (as long as jQuery is already loaded).

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

Sidebar

Related Questions

I'm using this php class ( http://www.white-hat-web-design.co.uk/articles/php-image-resizing.php ) for creating the different sized images
I'm using this: from twisted.web.client import getPage df = getPage(url) # there is some
I want to know if this web app are using long polling or anything
I am using Sinatra to design a web interface for some research we are
I'm working on the design of a web app which will be using AJAX
I’m trying to write a web app using 4-tier design pattern ( Data Store,
I am using this Web worker which has a Global variable declared in it.
I have this web application using Spring Web Flow framework. In my main page
I have this web service : using System.Web.Services; namespace Contracts { [WebService(Namespace = http://tempuri.org/)]
I'm using this code for my web assignment: http://csstechniques.blogspot.sg/2007/05/super-simple-css-bars.html But how do I show

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.