Saturday, 18 August 2012

Body Onlode Script Loaded not working in Advanced Chrome Browser

Issue with SharePoint 2010 and Google Chrome where the scrolling and ribbon do not work sometimes.


My master page has the following

<body scroll="no" onload="if (typeof(_spBodyOnLoadWrapper) != 'undefined') _spBodyOnLoadWrapper();" class="v4master">

Since I am using jQuery anyway, I pulled the code from the body onload and instead used a jQuery document ready method to call this: 

<script type="text/javascript">
  $(document).ready(function(){
   if (typeof(_spBodyOnLoadWrapper) != 'undefined') 
   {
    _spBodyOnLoadWrapper();
   }
  });
</script>


(or)

 just simply past on bottom of the Master page

 <script type="text/javascript">
  _spBodyOnLoadWrapper();
 </script>

Anyway - this seems to have solved my issue. Please try and let me know if this works for you as well.

1 comment:

  1. Thank you. This is a nice, elegant solution to the problem.

    In my case my CSSFriendly driven megamenu would fail on the second load of the page in Chrome. Was driving me nuts...

    I did find another solution that effectively does the same thing, just more targetted to Chrome and set to trigger only when it fails.

    http://mosswell.blogspot.com.au/2013/06/sharepoint-2010-and-chrome-javascript.html

    But I think I like yours better - covers everything all the time.

    ReplyDelete

KendoUI Chart using in AngularJS with Dynamic data

Here i'm going to do the KendoUI Chart using AngularJS  and getting dynamic data from angular services. First need to down-lode the r...