office addins - Excel Task Pane add-in to show content from external source -


i trying build excel/word task pane add-in should show content our site. content/data passed in xml format.

what have tried following:

office.initialize = function (reason) {     $(document).ready(function () {         app.initialize();          $.support.cors = true;          var data = '';          $.ajax({             type: "get",             contenttype: "application/json; charset=utf-8",             url: 'http://addons.mysite.com/excel-taskpane-data.php',             data: data,             datatype: "json",             success: onquerysuccess,             error: onqueryerror         });          function onquerysuccess(res, statustext) {             console.log('success!!' + res.statustext);         }         function onqueryerror(res, statustext){             console.log('failed!!' + res.statustext);         }    });  }; 

as can understand code above checking if connection made external source, getting "access denied" in console.

i not sure how should request data external source , whether possible @ all?

please help

you mentioned 'external' bet http://addons.mysite.com/ not domain serves web add-in. make work have check several things.

  1. serving https. written michael make sure use https. mixed content (mixing of http , https) blocked server , office web add-ins can served https.
  2. make sur php web api supports cors. no php expert here small link
  3. try specify https://addons.mysite.com appdomain sandboxed iframe allow request , navigation on same domain (the 1 use serve web-addin). can specify exceptions see here. works navigation , not sure works xhr...
  4. if step 3 did not work try use json/p techniques described here json/p office add-ins

Comments

Popular posts from this blog

java - pagination of xlsx file to XSSFworkbook using apache POI -

Unlimited choices in BASH case statement -

apache - How do I stop my index.php being run twice for every user -