导航到同一应用程序中的多个域时出现问题 [英] Issue with navigate to more than one domain within the same app
问题描述
我们想创建一个Excel应用程序,其起始页面将用户重定向到其他域(我们为每个客户分别设置了域名)。
We would like to create an application for Excel, starting page of which redirects user to other domains (we have separate domain for each customer).
我们按照说明操作这里描述: https://msdn.microsoft.com/en-us/library/office/jj715716.aspx?ppud = 4
We followed the instructions described here: https://msdn.microsoft.com/en-us/library/office/jj715716.aspx?ppud=4
但他们只帮我们桌面版Excel,在Excel Online中我们遇到conversationId问题。
But they helped us only for Desktop version of Excel, in Excel Online we have problems with conversationId.
如果在重定向期间我们只保留window.location.search - 关于null的例外 conversationId出现。
If during redirect we keep only window.location.search - exception about null conversationId appears.
如果在重定向期间我们传递window.location.search和window.location.hash - 我们在调用ContextActivationManager_getAppContextAsync期间出现错误,并显示消息'原因检查失败'。
If during redirect we pass window.location.search and window.location.hash - we have error during call to ContextActivationManager_getAppContextAsync with message 'Failed origin check'.
清单例如:
<?xml version="1.0" encoding="utf-8"?>
<OfficeApp
xmlns="http://schemas.microsoft.com/office/appforoffice/1.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:type="ContentApp">
<Id>01eac144-e75a-45a7-b6d7-f1cc60ab0129</Id>
<Version>1.0.0.0</Version>
<ProviderName>XYZ</ProviderName>
<DefaultLocale>en-US</DefaultLocale>
<DisplayName DefaultValue="XYZ Excel app" />
<Description DefaultValue="XYZ Excel app" />
<AppDomains>
<AppDomain>https://a.xyz.net</AppDomain>
<AppDomain>https://b.xyz.net</AppDomain>
</AppDomains>
<Hosts>
<Host Name="Workbook" />
</Hosts>
<DefaultSettings>
<SourceLocation DefaultValue="https://xyz.net/index.html" />
<RequestedWidth>400</RequestedWidth>
<RequestedHeight>300</RequestedHeight>
</DefaultSettings>
<Permissions>ReadWriteDocument</Permissions>
<AllowSnapshot>false</AllowSnapshot>
</OfficeApp>
推荐答案
嗨mfesenko,
Hi mfesenko,
>>但他们只帮助我们使用桌面版的Excel,在Excel Online中我们遇到了conversationId的问题。
我做了一个简单的演示作为链接,它在桌面和Excel Online中都有效。你对"conversationId"的意思是什么?我使用以下代码进行测试:
>> But they helped us only for Desktop version of Excel, in Excel Online we have problems with conversationId.
I made a simple demo with as the link, and it worked both in Desktop and Excel Online. What do you mean with "conversationId". I test with the code below:
<script type="text/javascript">
(document).ready(function(){
(document).ready(function () {
("#get-data-from-selection")。click(function(){
window.location =" http://www.google.com " ;;
});
} );
< / script>
("#get-data-from-selection").click(function () { window.location = "http://www.google.com"; }); }); </script>
如果您可以分享一个简单的演示来重现您的问题,将会很有帮助。
It would be helpful if you could share us a simple demo to reproduce your issue.
最好的问候,
Edward
这篇关于导航到同一应用程序中的多个域时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!