Skip to content

Instantly share code, notes, and snippets.

@ATGardner
Last active August 8, 2017 11:56
Show Gist options
  • Save ATGardner/8ab32841e12844b8335c12701af245d4 to your computer and use it in GitHub Desktop.
Save ATGardner/8ab32841e12844b8335c12701af245d4 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<meta http-equiv="cache-control" content="max-age=0"/>
<meta http-equiv="cache-control" content="no-cache"/>
<meta http-equiv="expires" content="0"/>
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT"/>
<meta http-equiv="pragma" content="no-cache"/>
<script src="https://appsforoffice.microsoft.com/lib/1/hosted/office.js" type="text/javascript"></script>
</head>
<body>
<script>
var init = false;
var bodyLoad = false;
window.Office.initialize = function () {
init = true;
if (bodyLoad && init) {
afterInit();
}
}
window.onload = function () {
bodyLoad = true;
if (bodyLoad && init) {
afterInit();
}
}
function afterInit() {
var div = document.getElementById('after');
div.innerText = 'after init';
}
</script>
<div>before init</div>
<div id="after"></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment