var isEditForm = function ()
{
var sPath = window.location.pathname;
var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);
if (sPage == "EditForm.aspx")
return true;
else return false;
}
And this one will tell you if we are in edit mode on publishing, web part or wiki pages
var isinEditMode = function() {
var isEditMode = false;
try {
var inDesignMode = document.forms[window.MSOWebPartPageFormName].MSOLayout_InDesignMode.value;
if (inDesignMode == "1") {
isEditMode = true;
}
} catch(e) {
}
try {
var wikiInEditMode = document.forms[window.MSOWebPartPageFormName]._wikiPageMode.value;
if (wikiInEditMode == "Edit") {
isEditMode = true;
}
} catch(e) {
}
return isEditMode;
};