本文介绍了在实施WOPI时获得服务不可用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

    var html =''

    var wopi_endpoint_url = encodeURIComponent(" https://www.mylocalhost.com/api/wopi/files/asfaf");

    var action_url =" https://excel.officeapps-df.live.com/x/_layouts/xlviewerinternal.aspx?WOPISrc ='" + wopi_endpoint_url +"'"

  &NBSP; html + ='< form id =" office_form"名称= QUOT; office_form"目标= QUOT; office_frame" action ="'+ action_url +'" method =" post">'

  &NBSP; html + ='< input name =" access_token"值= QUOT; 123" type =" hidden" />'

  &NBSP; html + ='< input name =" access_token_ttl"值= QUOT; 0" type =" hidden" />'

  &NBSP; html + ='< / form>'

  &NBSP; html + ='< span id =" frameholder">< / span>'


  &NBSP; $('。container.doc')。append(html)

  &NBSP; var frameholder = document.getElementById('frameholder');

  &NBSP; var office_frame = document.createElement('iframe');

  &NBSP; office_frame.name ='office_frame';

  &NBSP; office_frame.id ='office_frame';



  &NBSP; //应为无障碍设置标题

  &NBSP; office_frame.title ='Office Online Frame';



  &NBSP; //此属性允许幻灯片显示中的真正全屏模式

  &NBSP; //使用PowerPoint Online的"查看"操作时。

  &NBSP; office_frame.setAttribute('allowfullscreen','true');



  &NBSP; frameholder.appendChild(office_frame);



  &NBSP; document.getElementById('office_form')。submit();

    var html = ''
    var wopi_endpoint_url = encodeURIComponent("https://www.mylocalhost.com/api/wopi/files/asfaf");
    var action_url = "https://excel.officeapps-df.live.com/x/_layouts/xlviewerinternal.aspx?WOPISrc='" + wopi_endpoint_url +"'"
    html += '<form id="office_form" name="office_form" target="office_frame" action="' + action_url + '" method="post">'
    html += '<input name="access_token" value="123" type="hidden"/>'
    html += '<input name="access_token_ttl" value="0" type="hidden"/>'
    html += '</form>'
    html += '<span id="frameholder"></span>'

    $('.container.doc').append(html)
    var frameholder = document.getElementById('frameholder');
    var office_frame = document.createElement('iframe');
    office_frame.name = 'office_frame';
    office_frame.id ='office_frame';

    // The title should be set for accessibility
    office_frame.title = 'Office Online Frame';

    // This attribute allows true fullscreen mode in slideshow view
    // when using PowerPoint Online's 'view' action.
    office_frame.setAttribute('allowfullscreen', 'true');

    frameholder.appendChild(office_frame);

    document.getElementById('office_form').submit();

这是我在线测试的代码。如果你能指出这里的问题,那会有很大的帮助。 

This is my code I am testing for office online. If you could point out whats the problem here, that would of great help. 

推荐答案

感谢您发布有关MS-WOPI的问题以及您遇到"服务不可用"错误的原因。我们已经创建了一个服务请求来跟踪您的问题,开放规范团队的成员将审核您的问题并在此处针对您的问题发布

Thank you for posting your question regarding MS-WOPI and why you are encountering a 'Service Unavailable' error. We have created a service request to track your issue and a member of the Open Specifications team will be reviewing your issue and posting here regarding your question.

此致,


这篇关于在实施WOPI时获得服务不可用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-06 08:55