This page is Almost Ready

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

importScripts

Summary

Fetches one or more script resources, identified by absolute URLs.

Method of apis/workers/WorkerGlobalScopeapis/workers/WorkerGlobalScope

Syntax

 object.importScripts(urls);

Parameters

urls

Data-type
String

Return Value

No return value

Notes

A URL that is loaded must resolve according to the WorkerLocation of the worker. More than one script can be loaded in a sequence of URLs. The loading and executing of scripts is synchronous. If any script throws an exception, subsequent scripts will not load.

Related specifications

W3C Web Workers Specification
W3C Editor’s Draft

Attributions