Friday, June 24, 2011

To Find if the Page in MOSS is in Design Mode

Some Times we have to make the Jquery/JavaScript run when its not in the design mode.
I don't know how many of us has noted this tag "MSOLayout_InDesignMode" .This is a hidden HTML field present on the page. So using that its simple.

The HTML looks like this:
<input type="hidden" name="MSOLayout_InDesignMode" id="MSOLayout_InDesignMode" value="" />
if (document.getElementById("MSOLayout_InDesignMode").value != "1")
{
//do something
}
else
{
//do something
}

No comments:

Post a Comment