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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T16:55:32+00:00 2026-06-02T16:55:32+00:00

I have some JavaScript(1.7.2) in an external .js file that’s working ok. But after

  • 0

I have some JavaScript(1.7.2) in an external .js file that’s working ok. But after checking in IE compatibility mode to ensure it works with IE7+, I hit a problem. In the function loader(), which is called at page load, calling chooseImage(img) prevents subsequent calling of timeImgChange(). If I change the order of these two calls, the problem persists with chooseImage() not being called. Hope someone can help, Neil.

window.onload = loader;

function loader(){
    var img = document.getElementById('selector_chicks');
    chooseImage(img); //This function call works
    timeImgChange();  //Not called. Works in IE9. Is called if chooseImage() is removed
}


function chooseImage(img){
    document.getElementById('chooseimage').src = imageMap[img.title].path;
    document.getElementById(img.id).style.background = "#A66B00";
    document.getElementById('textselected').innerHTML = imageMap[img.title].text;

    /*unselect the other divs*/
    var selectors = document.getElementsByClassName('selector');
    for (var i = 0; i < selectors.length; i++){
        if (selectors[i].title != img.title){
            selectors[i].style.background = "#261e1e";
        }
    }
}

function timeImgChange() {  /*Change the image ever x milliseconds*/
    var imgIdArray = ["selector_egg", "selector_chicks", "selector_poults"];
    var n = 1;
    setInterval(function(){ 
      if (doImageCycle){
          var img = document.getElementById(imgIdArray[n]);
          chooseImage(img);
          n++;
          if (n > 2) {n = 0;}
       }
     }, 2000); 
}
  • 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-02T16:55:33+00:00Added an answer on June 2, 2026 at 4:55 pm

    IE < 9 doesn’t support getElementsByClassName. Since the chooseImage function relies on it, the engine will throw an error instead of continuing to run your code.

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

Sidebar

Related Questions

i have some javascript roll over code that works fine in firefox but when
I have an external javascript file that I want to, upon include, write some
I have a flash movie that requires some JavaScript from an include file but
I have a page that pulls an external JavaScript file, which then generates some
I have some jQuery code in an external Javascript file that is making an
I have some external Javascript files in my GWT app that I only want
I have some javascript array that I append within a function and call after
I have some JavaScript code that works in IE containing the following: myElement.innerText =
I have an external JavaScript file that will be used on pages with lots
I have some javascript that goes out and fetches a javascript class on another

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.