isOnPremises (Client API reference)
Returns a boolean value indicating if the model-driven apps instance is hosted on-premises or online.
Syntax
var globalContext = Xrm.Utility.getGlobalContext();
globalContext.isOnPremises();
Return Value
Type: Boolean
Description: true if the model-driven apps instance is on-premises; false otherwise.