I am building a SPA using SP 2010 as my back end but with custom HTML/CSS/JS deployed to a subfolder of _Layouts. I get everything I need from ListData.svc with the exception of the current logged on user which I would like to just get using CSOM. Is there a list of the required JS files that I must load to get access to the CSOM? Currently I am experiencing:

Uncaught ReferenceError: FV4UI is not defined -- ( CORE.js: 2 )

The reason why I have chosen to go this route is that a frequent complaint from my users is that "SharePoint is slow". I want to have the most complete control over my HTML and the presentation of the data as well as use the advanced features of HTML5 that seem to cause the standard SharePoint 2010 UI a lot of grief.

I am loading the folloowing JS files and of course I only want to load the files that are required:

<script type="text/javascript" src="../MicrosoftAjax.js"></script>
<script type="text/javascript" src="../1033/CORE.js"></script>
<script type="text/javascript" src="../1033/INIT.js"></script>
<script type="text/javascript" src="../SP.Core.js"></script>
<script type="text/javascript" src="../sp.js"></script>

The error may be throws because core.js loaded before init.js (because FV4UI function is part of init.js file).

Also, check this post.

<!-- the following 5 js files are required to use CSOM -->
<script src="/_layouts/1033/init.js"></script>
<script src="/_layouts/MicrosoftAjax.js"></script>
<script src="/_layouts/sp.core.js"></script>
<script src="/_layouts/sp.runtime.js"></script>
<script src="/_layouts/sp.js"></script>
|improve this answer|||||
  • 1
    Interesting blog! – Christophe May 20 '13 at 18:04
  • While helpful, that still isn't enough. I'm now getting Cannot read property 'webServerRelativeUrl' of undefined. I'll try and add additional details. – Robert Kaucher May 20 '13 at 19:46
  • When ever I tried to execute my code in a Revealing Module function I got error after error. Once I took the code out of the RMP function, everything worked with the answer above. – Robert Kaucher May 20 '13 at 21:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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