共用方式為


SP.Site.openWeb(strUrl) Method

Applies to: SharePoint Foundation 2010

In this article
Return Value
Remarks
Applies To
Remarks

Opens a new site using the specified URL.

var value = SP.Site.openWeb(strUrl);

Parameters

  • strUrl
    Specifies the server-relative URL or web-relative URL of the site to open.

Type: String

Return Value

Type: SP.Web

The server-relative URL or web-relative URL of the site to open.

Remarks

If strUrl is empty, the top-level site is opened.

Applies To

SP.Site Class

Exceptions

  • ArgumentException
    The specified URL must refer to a valid site. Error code: -2147024809.

Remarks

It must not be null.

See Also

Reference

SP.Site Methods

SP.Site Properties

SP Namespace