Hi there,

I've looked through the jspax code, and it looks like he's creating an
explicit test once the package is loaded as I suggested initially.
This can can also be achieved without the second script element:

function loadExtScript(src, test, callback) {
  var s = document.createElement('script');
  s.src = src;
  document.body.appendChild(s);

  var callbackTimer = setInterval(function() {
    var call = false;
    try {
      call = test.call();
    } catch (e) {}

    if (call) {
      clearInterval(callbackTimer);
      callback.call();
    }
  }, 100);
}

Where test, in the case of loading jQuery externally, is passed in as:

function() { return (typeof jQuery == 'object'); }

But without the test, you can't tell when Safari has loaded the script.

Reply via email to