Load script from the provided url and pass the content to the callback.
336309
function load(url, successCallback, errorCallback) {
  const xhr = new XMLHttpRequest();

  // async, however scripts will be executed in the order they are in the
  // DOM to mirror normal script loading.
  xhr.open("GET", url, true);
  if ("overrideMimeType" in xhr) {
    xhr.overrideMimeType("text/plain");
  }
  xhr.onreadystatechange = function() {
    if (xhr.readyState === 4) {
      if (xhr.status === 0 || xhr.status === 200) {
        successCallback(xhr.responseText);
      } else {
        errorCallback();
        throw new Error("Could not load " + url);
      }
    }
  };
  return xhr.send(null);
}
1268466
def loadFromURL(self, url):
        """"""
        document = DOM.loadFromURL(url)
        wsdl = WSDL()
        wsdl.location = url
        wsdl.load(document)
        return wsdl
535348
private static void loadScript(ScriptEngine engine, Supplier<Reader> scriptReader) {

        try (Reader reader = scriptReader.get()) {
            engine.eval(reader);
        } catch (ScriptException | IOException e) {
            throw new RuntimeException(e);
        }

    }
380615
def load_script(zap_helper, **options):
    """"""
    with zap_error_handler():
        if not os.path.isfile(options['file_path']):
            raise ZAPError('No file found at "{0}", cannot load script.'.format(options['file_path']))

        if not _is_valid_script_engine(zap_helper.zap, options['engine']):
            engines = zap_helper.zap.script.list_engines
            raise ZAPError('Invalid script engine provided. Valid engines are: {0}'.format(', '.join(engines)))

        console.debug('Loading script "{0}" from "{1}"'.format(options['name'], options['file_path']))
        result = zap_helper.zap.script.load(options['name'], options['script_type'], options['engine'],
                                            options['file_path'], scriptdescription=options['description'])

        if result != 'OK':
            raise ZAPError('Error loading script: {0}'.format(result))

    console.info('Script "{0}" loaded'.format(options['name']))
1344773
function loadJSON (path, callback) {
  var xobj = new XMLHttpRequest();
  xobj.overrideMimeType('application/json');
  xobj.open('GET', path, true);
  xobj.onreadystatechange = function () {
    if (xobj.readyState === 4 && xobj.status === 200) {
      callback(xobj.responseText);
    }
  };
  xobj.send(null);
}
8488
function loadScripts(scripts, loadedCallback) {
    var srcs = [], property, count, i, src,
        countDown = function () {
          count -= 1;
          if (!count) {
            loadedCallback();
          }
        };

    for (property in scripts) {
      if (!(property in window)) {
        srcs.push(scripts[property]);
      }
    }

    count = srcs.length;
    if (!count) {
      loadedCallback();
    }

    for (i = 0; i < srcs.length; i += 1) {
      src = srcs[i];
      loadScript(src, countDown);
    }
  }
410473
function _load(source, callback) {
  fs.readFile(source, {encoding: 'utf8'}, _jsonLoaded.bind(null, callback));
}
1148890
function(url) {
  var done = _onImportScript(url)
  loadScript(
    url,
    function runScript(err, code) {
      if (err) return done(err)
      executeNormal(code, url, done)
    }
  )
}
890886
function loadScript(url, callback, errorCallback, $timeout) {
    var script = document.createElement('script'),
      body = document.getElementsByTagName('body')[0],
      removed = false;

    script.type = 'text/javascript';
    if (script.readyState) { // IE
      script.onreadystatechange = function () {
        if (script.readyState === 'complete' ||
            script.readyState === 'loaded') {
          script.onreadystatechange = null;
          $timeout(
            function () {
              if (removed) return;
              removed = true;
              body.removeChild(script);
              callback();
            }, 30, false);
        }
      };
    } else { // Others
      script.onload = function () {
        if (removed) return;
        removed = true;
        body.removeChild(script);
        callback();
      };
      script.onerror = function () {
        if (removed) return;
        removed = true;
        body.removeChild(script);
        errorCallback();
      };
    }
    script.src = url;
    script.async = false;
    body.appendChild(script);
  }
1302062
function loadScript(redis, script_name, script, callback) {
  redis.multi()
    .script('load', script)
    .exec(function (err, sha1) {
      if (err) {
        return callback(err);
      }
      shas[script_name] = sha1 && sha1.length && sha1[0];
      callback(null, sha1);
    });
}
1194034
function loadExternal(href, callback) {
	var cacheEntryType = typeof requestCache[href];
	if (cacheEntryType === 'string') {
		callback(requestCache[href]);
		return;
	}
	else if (cacheEntryType === 'object') {
		requestCache[href].push(callback);
		return;
	}
	requestCache[href] = [callback]
	var isDone = false;
	var done = function(response) {
		if (!isDone) {
			response = response || '';
			requestCache[href].forEach(function(cachedCallback) {
				setTimeout(function() {
					cachedCallback(response);
				});
			});
			requestCache[href] = response;
		}
		isDone = true;
	};
	var xhr = new XMLHttpRequest();
	xhr.onreadystatechange = function() {
		if (xhr.readyState !== 4) {
			return;
		}
		done(xhr.status === 200 && xhr.responseText);
	};
	try {
		xhr.open('GET', href);
		xhr.send();
	}
	catch(e) {
		if (window.XDomainRequest) {
			xhr = new XDomainRequest();
			xhr.onprogress =
				/* istanbul ignore next: fix for a rare IE9 bug */
				function() {};
			xhr.onload = xhr.onerror = xhr.ontimeout = function() {
				done(xhr.responseText);
			};
			try {
				xhr.open('GET', href);
				xhr.send();
			}
			catch(e2) {
				done();
			}
		}
		else {
			done();
		}
	}
}
21763
function ajax(url, options, callback) {
        if (typeof options === 'function') {
          callback = options;
          options = {};
        }
        callback = callback || function () {};
        var xhr = new XMLHttpRequest();
        xhr.onload = function () {
          if (xhr.status >= 400) {
            return callback(new Error(xhr.responseText || xhr.statusText));
          }
          try {
            return callback(null, JSON.parse(xhr.responseText));
          } catch (e) {
            return callback(new Error('invalid_response'));
          }
        };
        xhr.onerror = function (err) {
          return callback(err);
        };
        xhr.open('GET', url);
        xhr.send();
      }
1258467
def loads(self, string):
        ""
        script_class = self.get_script_class()
        script = self._load(BytesIO(string), self._protocol, self._version)
        return script_class(script)
834384
def _load_url(url):
    
    try:
        response = requests.get(url)
        return BytesIO(response.content)
    except IOError as ex:
        parser.error("{url} could not be loaded remotely! ({ex})".format(url=url, ex=ex))
1236067
def insert_from_urls(urls, contenthandler, **kwargs):
	
	verbose = kwargs.get("verbose", False)

	#
	# load documents
	#

	for n, url in enumerate(urls, 1):
		if verbose:
			print >>sys.stderr, "%d/%d:" % (n, len(urls)),
		insert_from_url(url, contenthandler = contenthandler, **kwargs)

	#
	# done.  build indexes
	#

	dbtables.build_indexes(contenthandler.connection, verbose)
620189
function getScript(url) {
		
		var script = scripts[url.name || url];
		if (script) { return script; }
		
		if (typeof url == 'object') {
			for (var key in url) {
				if (url[key]) {
					script = { name: key, url: url[key] };
				}
			}
		} else {


			var els = url.split("/"),
				 name = els[els.length -1],
				 i = name.indexOf("?");
				 
			script = {
				name: i != -1 ? name.substring(0, i) : name, 
				url: url 
			}; 
		}
		
		scripts[script.name] = script;
		return script;
	}
891032
function loadScript(url, done) {
  var script = doc.createElement('script');
  script.src = url;
  script.onload = onreadystatechange = function() {
    if (!this.readyState ||
        this.readyState === 'load' ||
        this.readyState === 'complete') {
      done && done();
      script.onload = onreadystatechange
      script.parentNode.removeChild(script);
    }
  };
  body.appendChild(script);
}