SharePoint 2013应用程序重新调整大小问题

时间:2016-12-28 08:57:16

标签: javascript sharepoint sharepoint-2013

我正在开发一个SharePoint托管应用程序&需要根据内容和计算来计算动态高度。屏幕分辨率,保持宽度为100%。我在下面的代码和&我有2个场景。

  1. host-web& HTTP上的app-web - 效果很好
  2. HTTP上的host-web,而HTTPS上的app-web - Web部分没有调整大小。
  3. 我无法确定问题,因为我也没有在开发者信息中心看到任何错误。任何人都可以帮我这个吗?

    
    
    < script type = "text/javascript" >
      window.Communica = window.Communica || {};
    
    $(document).ready(function() {
      Communica.Part.init();
    });
    
    Communica.Part = {
      senderId: '',
    
      init: function() {
        var params = document.URL.split("?")[1].split("&");
        for (var i = 0; i < params.length; i = i + 1) {
          var param = params[i].split("=");
          if (param[0].toLowerCase() == "senderid")
            this.senderId = decodeURIComponent(param[1]);
        }
    
    
        this.adjustSize();
      },
    
      adjustSize: function() {
        var resizeMessage = '<message senderId={Sender_ID}>resize({Width}, {Height})</message>';
    
        resizeMessage = resizeMessage.replace("{Sender_ID}", this.senderId);
        //Dynamic height to be calculated, at the moment fixed height is also not working
        resizeMessage = resizeMessage.replace("{Height}", "500px");
        resizeMessage = resizeMessage.replace("{Width}", "100%");
    
        window.parent.postMessage(resizeMessage, "*");
      }
    }; < /script>
    &#13;
    <div id="userDataContent">
      "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor
      in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
    </div>
    &#13;
    &#13;
    &#13;

0 个答案:

没有答案