Uploaded image for project: 'Tapestry 5'
  1. Tapestry 5
  2. TAP5-1731

Dynamic loading of JavaScript libraries is sometimes broken in IE (in rare cases)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 5.3
    • 5.3
    • tapestry-core

    Description

      Problem is in this code:

      addScripts : function(scripts, callback) {

      var _ = T5._;

      var loaded = _(document.scripts).chain().pluck("src").without("").map(this.rebuildURLIfIE).value();

      var topCallback = _(scripts).chain().map(Tapestry.rebuildURL).difference(loaded).reverse().reduce(
      function (nextCallback, scriptURL) {
      return function()

      { this.loadScript(scriptURL, nextCallback); }

      }, callback).value();

      // Kick if off with the callback that loads the first script:

      topCallback.call(this);
      },

      In the nested callback, the "this" variable is not set to the right value, at least not inside ie. Need to fully qualify (Tapestry.ScriptLoader.loadScript()) or other bind this.

      Attachments

        Activity

          People

            hlship Howard Lewis Ship
            hlship Howard Lewis Ship
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: