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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:10:54+00:00 2026-05-23T10:10:54+00:00

I stripped down this javascript to be as simple as possible, and it’s still

  • 0

I stripped down this javascript to be as simple as possible, and it’s still not working in IE8.

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload !== 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    };
  }
}

function callkits() {
    alert('Kits: Bug testing');
}

//addLoadEvent(callkits);
//window.onload = callkits;
window.onload = function() {
    callkits();
};

Neither of the two commented out methods, nor the active method, do anything in IE8. Javascript is enabled. (Calling alert directly, outside a function, does work.) I’m tearing my hair out here.

Edit:

Okay, it’s now even simpler:

alert('Before onload.')

window.onload = function() {
    alert('Onload');
};

alert('After onload');

In Firefox, Opera, Safari, and Chrome, I get “Before onload”, “After onload”, then the page appears, then “Onload”. In IE8, that last step doesn’t happen. window.onload simply isn’t firing.

  • 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-23T10:10:55+00:00Added an answer on May 23, 2026 at 10:10 am

    The standard onload event won’t work if another script is called using an HTML defer command.

    <script for="window" event="onload" defer="1">products.related();</script>

    Changing the above to use the standard addLoadEvent() function made it work.

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

Sidebar

Related Questions

A very stripped down example here . Code: function changeBackground() { var testDiv =
I have a jQuery function (stripped down just for this example): (function($) { $.fn.Lightbox
Below is a jquery script I am working on, I have stripped down all
I am using boost shared_ptr with my own memory manager like this (stripped down
I stripped down my app but this should give you an example of what
I'm getting this error when running a .net 2.0 app on a stripped-down XP
Here is a stripped down version of what I use to authenticate users, it
My users are presented a basically a stripped down version of a spreadsheet. There
I'm trying to create an access control system. Here's a stripped down example of
I've been exploring the use of custom functions for event handlers. In this stripped

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.