Check if it’s edit mode in javascript in Sharepoint

var wikiInEditMode = document.forms[MSOWebPartPageFormName]._wikiPageMode.value;
if (wikiInEditMode == “Edit”)
{
// wiki page is in edit mode
}
else
{
// wiki page is not in edit mode
}

Another solution http://sharepoint.stackexchange.com/questions/12792/how-do-i-know-if-the-page-is-in-edit-mode-from-javascript

var inDesignMode = document.forms[MSOWebPartPageFormName].MSOLayout_InDesignMode.value;

if (inDesignMode == "1")
{
    // page is in edit mode
}
else
{
    // page is in browse mode
}

Leave a Reply

Your email address will not be published. Required fields are marked *