Read Data from Sharepoint in a office app RRS feed

  • Question

  • Hello

    I'm trying to read some data from a sharepoint 2013 list in an office task pane.
    I tried connecting with the javascript CSOM, with no success. The code is:


    function () {
        hostweburl = hosturl;
        appweburl = appweb;

        var scriptbase = hostweburl + "/_layouts/15/";

        $.getScript(scriptbase + 'SP.Runtime.js',     

     function () {$.getScript(scriptbase + 'SP.js',          
     function () { $.getScript(scriptbase +
     'SP.RequestExecutor.js', registerContextAndProxy)})


         function registerContextAndProxy() {
             context = new SP.ClientContext(appweburl);
             var factory = new SP.ProxyWebRequestExecutorFactory(appweburl);



    SP.ClientContext is undefined.

    Thanks for your help. Regards



    Friday, September 28, 2012 1:20 PM


All replies

  • Did you try substituting in values for "appweb" and "hosturl"?

    Which line is throwing the exception?

    Please do not forget to click “Vote as Helpful” if any post helps you and "Mark as Answer”if it solves the issue.

    Monday, October 1, 2012 1:36 AM
  • Hi Mike

    Thanks for your answer.

    The url's seem to be ok. It's the line:

    context = new SP.ClientContext(appweburl);

    ClientContext is undefined, as if not loaded yet?

    If I run the code in a sharepoint app (slightly modified, SP.ClientContext.get_current(), no ProxyWebRequest...), all works fine.



    Monday, October 1, 2012 7:26 AM
  •  context = SP.ClientContext.get_current();
            web = context.get_web();

    This Works for me.

    Robert Stark Aurora Sky Technology Partners

    Wednesday, November 28, 2012 10:27 PM