• 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);
    }
  • 相关阅读:
    oracle nvl,to_char 函数(二)
    GridView的使用技巧
    asp.net应用程序性能的提高方案
    浅谈 ViewState
    最为关心的问题,hbase查询一条数据的过程.
    HBase的弊端。
    拙建:(mapreduce 如何来分步统计词频)
    终于找到hbase分布式存储数据的方式.
    迷局一般的openjdk6jdk!
    IT事业不好走,大家在虚拟的世界,记得回到真实的世界,不然你将会成为下一个张孝祥.
  • 原文地址:https://www.cnblogs.com/ahghy/p/2842891.html
Copyright © 2020-2023  润新知