5

I'm experimenting with using CSOM and Web Workers as many of my users use Chrome and FireFox. Currently I am importing SP.js and SP.Core.js

importScripts("../SP.js", "../SP.Core.js");

What other scripts do I need to import? Currently I am getting the error

Type is not defined.

Any advice would be appreciated.

1 Answer 1

4

If you add a reference to /_Layouts/MicrosoftAjax.js you no longer get the Type is not defined error. The problem then becomes that Type is defined as inheriting from window.

Type Class

Provides a typing and type-reflection system for ECMAScript (JavaScript) object-oriented programming functionality.

Namespace: None. The Type methods are global and not part of a namespace.

Inherits: window.

Of course, a Web Worker does not have access to the window object. So it appears that it is not possible to use the CSOM with a Web Worker.

Window, Self, and Web Workers

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.