Hi,
I have sharepoint hosted app that gets hostweburl and appweburl with the next lines
function getUrl() { hostweburl = getQueryStringParameter("SPHostUrl"); appweburl = getQueryStringParameter("SPAppWebUrl"); hostweburl = decodeURIComponent(hostweburl); appweburl = decodeURIComponent(appweburl); var scriptbase = hostweburl + "/_layouts/15/"; $.getScript(scriptbase + "SP.Runtime.js", function () { $.getScript(scriptbase + "SP.js", function () { $.getScript(scriptbase + "SP.RequestExecutor.js", execOperation); } ); } ); } function execOperation() { context = new SP.ClientContext(appweburl); appContextSite = new SP.AppContextSite(context, hostweburl); }
And this works fine. But when I'm creating app part those hostweburl and appweburl fields are undefined. So I cant get the context and everything is broken. Is this done in some other way in app parts?