EN
Ce contenu n’est pas disponible dans votre langue. Voici la version anglaise.

msIsSiteMode method

Determines whether the current page was launched as a pinned site.

Internet Explorer 9

 

Syntax

object.msIsSiteMode(siteMode)

Parameters

This method has no parameters.

Return value

Type: boolean

Returns true if the current page was launched as a pinned site; false otherwise.

Standards information

There are no standards that apply here.

Remarks

You can use this method to configure your webpages differently if they are running as a pinned site versus the normal browser mode.

Only pages within the same domain as the pinned site start URL are considered to be part of the pinned site. If a page from a different domain is opened inside the pinned site window, then msIsSiteMode returns true.

To pin a site, Windows Internet Explorer requires Windows 7 or later.

Examples

The following script redirects to a start page if the current window is already running as a pinned site. The try/catch statement allows the script to recover gracefully if the call is not supported by the browser.


function testSiteMode()
{
    try {
        if (window.external.msIsSiteMode()) {
            location.href = startPage;
        }
    }
    catch(ex) {
        alert("Site Mode is not supported.");
        return;
    }
}
window.onload = testSiteMode;

See also

external
window
msAddSiteMode

 

 

Afficher:
© 2014 Microsoft