Last active
May 23, 2017 07:13
-
-
Save hammadbinarif/d1bbeb34b6eab12f7eb5cbfff172b870 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_spBodyOnLoadFunctionNames.push("myScriptStartup"); | |
function myScriptStartup () { | |
var inDesignMode = document.forms[MSOWebPartPageFormName].MSOLayout_InDesignMode.value; | |
if (inDesignMode == "1") { | |
// page is in edit mode | |
// Do things differently here | |
console.log('Page is in edit mode. so we will not execute the custom script'); | |
} | |
else { | |
// regular script execution goes here | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment