Yes there is.
Look for the MSOLayout_InDesignMode attribute in the javascript.
var inDesignMode = document.forms[MSOWebPartPageFormName].MSOLayout_InDesignMode.value; if (inDesignMode == "1") { // page is in edit mode } else { // page is in browse mode }This will refer to value of the following html input control, which is rendering on the page when it is in edit mode:
For wiki pages, you will need _wikiPageMode parameter
var wikiInEditMode = document.forms[MSOWebPartPageFormName]._wikiPageMode.value; if (wikiInEditMode == "Edit") { // wiki page is in edit mode } else { // wiki page is not in edit mode }
No comments:
Post a Comment