zoukankan      html  css  js  c++  java
  • SharePoint 2010 在chrome 谷歌浏览器中滚动条的问题

    SharePoint and Chrome

    A few months ago I posted an entry called SharePoint 2010 Scrolling detailing a method to get scrolling working on less supported browsers in SharePoint 2010. Along with some background on to why the method works.

    So, I’ve had reason recently to revisit Chrome and SharePoint compatibility specifically as of late. In the process a different fix came out of it. One that is less heavy-handed. But more importantly I found out that the cause of the scrolling inconsistency on some browsers like iOS Safari and Chrome is NOT due to the causes that have been previously documented by other bloggers or myself. The cause is in fact a timing issue around execution of a specific bit of very important onload JavaScript.

    The bit that doesn’t execute (and causes a systemic issue, one of the issues it causes is the scrolling weirdness), is:

    body onload=”if(typeof(_spBodyOnLoadWrapper) != ‘undefined’; _spBodyOnLoadWrapper();”

    What this line means is basically if the page has loaded the onloadwrapper function from init.js. This onloadwrapper does a bunch of things, such as loading the ECMAScript for support SP.JS, executes page JavaScript for any onload events, and any client interactivity. So basically when this doesn’t execute pretty much no client side code from SharePoint can or will work, or any script that you have that relies on any of it. Scrolling is just the tip of the ice berg. Now for the good news, it’s easy to fix (I have a case in with Microsoft to look at including the fix in a future cumulative update).

    Lastly, before showing the work around. SharePoint is not the only site affected by this issue, if you have a site loading JavaScript dynamically or via lazy loading and within that JavaScript have defined an OnLoad function, you can also run in to this issue.

     
     
    $(document).ready(function()
    {
        Reinit();
    });
    
    function Reinit()
    {
        //verify we have finished loading init.js
        if(typeof(_spBodyOnLoadWrapper) != 'undefined')
        {
            //verify we have not already initialized the onload wrapper
            if(_spBodyOnloadCalled == false)
            {
                //initialize onload functions
                _spBodyOnLoadWrapper();
            }
        }
        //wait for 10ms and try again if init.js has not been loaded
        else
        {
            InitTimer();
        }
    }
    
    function InitTimer()
    {
        setTimeout(Reinit,10);
    }
  • 相关阅读:
    Java实现数字转化成字符串左边自动补零方法
    java如何对map进行排序详解(map集合的使用)
    java字符串比较的原理
    rancher快速创建mysql和redis
    k8s Ingress介绍和部署IngressController
    k8s+rancher+阿里云镜像简单部署flask项目
    helm 部署minio
    k8s存储数据卷
    k8s搭建redis集群
    团队作业4:第二篇Scrum冲刺博客
  • 原文地址:https://www.cnblogs.com/ahghy/p/2842891.html
Copyright © 2011-2022 走看看