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)

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.3
    • Fix Version/s: 5.3
    • Component/s: tapestry-core
    • Labels:

      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

            • Assignee:
              hlship Howard M. Lewis Ship
              Reporter:
              hlship Howard M. Lewis Ship
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: