Uploaded image for project: 'Click'
  1. Click
  2. CLK-617

addLoadEvent doesn't always work in IE

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.1.0 RC1
    • 2.1.0
    • core
    • None

    Description

      Its possible that addLoadEvent doesn't fire correctly when using IFRAMEs in IE.

      On the dev list James have contributed this patch:

      if (window == top) {
      var d = window.document;
      (function () {
      try

      { d.documentElement.doScroll('left'); }

      catch (e)

      { setTimeout(arguments.callee, 50); return; }
      // Dom is ready, run events
      Click.domready.run();
      })();
      } else {
      var d = document;
      (function () {
      if (d.body==null) { setTimeout(arguments.callee, 50); return; }


      // Dom is ready, run events
      Click.domready.run();
      })();
      }

      JQuery also uses a similar check whether document.body is null as well as an onreadystatechange event for IFRAMES:

      More info can be read here:
      http://www.subprint.com/blog/demystifying-the-dom-ready-event-method/

      and here (see the bindReady and ready functions):
      http://code.jquery.com/jquery-1.4.js

      Attachments

        Activity

          People

            sabob Bob Schellink
            sabob Bob Schellink
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment