1

How can I run some javascript code only on edit page? I have a check box in edit mode that I want to get the value of in my publish page. So the only way I can see of doing in this, is running some code while in edit page getting the value of the check box and then using the variable storing the value in my published page

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

if (inDesignMode == "1")
{
    // page is in edit mode write code here

}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.