Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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.

share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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