Skip to content

Instantly share code, notes, and snippets.

@alirobe
Last active January 13, 2017 18:54
Show Gist options
  • Save alirobe/4224245 to your computer and use it in GitHub Desktop.
Save alirobe/4224245 to your computer and use it in GitHub Desktop.
Fix an issue where occasionally the JavaScript that runs a SharePoint 2010 page's dynamic elements (ribbon, scrolling, etc) fails to initialise in Webkit browsers.
//via http://withinsharepoint.com/archives/256 or http://withinsharepoint.com/archives/210
if (jQuery.browser.webkit) {
jQuery(document).ready(function () {
var interval;
function loopCheck() {
if (typeof (_spBodyOnLoadWrapper) !== "undefined" && _spBodyOnLoadCalled == false)
_spBodyOnLoadWrapper();
else
window.clearInterval(interval);
}
// Give SP a chance..
setTimeout(function () { interval = window.setInterval(loopCheck, 30); }, 120);
});
}
@gkatsanos
Copy link

excellent solution, thanks both to you and Maarten for the clean fix!

@lostuser23
Copy link

Great solution!

@Ofer-Gal
Copy link

Ofer-Gal commented Jan 13, 2017

Did not work for me.
Should it be in the <head> section of the HTML that makes the Master in SP2013?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment