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.
- serving https. written michael make sure use https. mixed content (mixing of http , https) blocked server , office web add-ins can served https.
- make sur php web api supports cors. no php expert here small link
- 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...
- if step 3 did not work try use json/p techniques described here json/p office add-ins
Comments
Post a Comment