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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T03:59:52+00:00 2026-06-11T03:59:52+00:00

My site is http://littlehousearts.com . I am using Prestashop and have added javascript to

  • 0

My site is http://littlehousearts.com. I am using Prestashop and have added javascript to display a banner on every page load. Currently I only have one banner image and it loads fine on the home page and category pages. But it does not load always on the product pages. I am able to view source and see the script tag appropriately in the source. The tag I used is:

<script src="banner.js" type="text/javascript"></script>

The code in the javascript file is:

function random_imglink(){
  var myimages=new Array();
  index=0;

  //specify random images below. You can have as many as you wish
  myimages[1]="<a href='http://littlehousearts.com/28_golden'><img src='/img/golden.png' width='943' alt='GOLDEN Acrylic Paints' /></a>";     

  index=Math.floor(Math.random()*myimages.length);

  if (index == 0){
    index=1;
  }

  document.write(myimages[index]);
}
random_imglink();

The banner I currently have loading is under “earn credits” and displays Golden professional quality colors.

Any idea why this would not load on some pages? I tested it to load a non existent image and there should be a text in that position that reads undefined but that doesn’t even show up on the pages where it is missing.

  • 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-11T03:59:54+00:00Added an answer on June 11, 2026 at 3:59 am

    My guess it’s that you have that problem because you use relative URLs.

    Then, banner.js points to a file in the current directory. So, if you are in “http://littlehousearts.com”, it points to “http://littlehousearts.com/banner.js”, but if you are in “http://littlehousearts.com/a/”, it points to “http://littlehousearts.com/a/banner.js”.

    Instead of this, you should use relative URLs to your site’s root:

    <script src="/banner.js" type="text/javascript"></script>
    

    This way, it will always point to “http://littlehousearts.com/banner.js”

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

Sidebar

Related Questions

On my site: http://alsite.com.br/solalev/ I have some elements on the bottom of page that
I have a site http://pintum.com.au/goCruising/ I am using Easy Slider 1.7 with a few
Site: http://clientfiles.priworks.com/lgmanagedportfolios/test/investment.html I have been working at this web page for a while now
This site http://doomedfromdayonemerch.bigcartel.com/ is currently scrolling too much down the page, this is because
I have a web site http://www.mydomain.com Here I have created a sub folder http://www.mydomain.com/products
Test site: http://wfwgm.stage.philosophydesign.com/ I have included: <script src=http://ie7-js.googlecode.com/svn/version/2.1(beta4)/IE9.js></script> to give :before support in IE6
I have a site http://test.printavo.com that renders terribly in IE8 but fine in IE7
so I have this site: http://webzilla-il.com/contactus.php , now i know it's not in english
Here is the site: http://wesbos.com/tf/shutterflow/?cat=1 The banner image at the side that says S&S
I have the below site: http://kelseydelo.com/ When I click the main nav links in

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.