UNPKG

dojo

Version:

Dojo core is a powerful, lightweight library that makes common tasks quicker and easier. Animate elements, manipulate the DOM, and query with easy CSS syntax, all without sacrificing performance.

47 lines (43 loc) 935 B
// summary: // Test loading json via dojo/request in a worker. var dojoConfig = { baseUrl: "../../../../../", async: true, packages: [{ name: "dojo", location: "dojo" }] }; importScripts("../../../../dojo.js", "console.js"); try{ require(["dojo/request"], function(request){ request("../../../../testsDOH/_base/loader/hostenv_webworkers/worker5.json", { handleAs: "json" }).then(function(data) { if(data.foo && !data.bar){ self.postMessage({ type: "testResult", test: data, value: true }); }else{ self.postMessage({ type: "testResult", test: "require is working", value: false }); } }, function(){ self.postMessage({ type: "testResult", test: "request in a worker is working", value: false }); }); }); }catch(e){ self.postMessage({ type: "testResult", test: "request in a worker is working", value: false }); }