Enum OpenAs
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
開啟此列舉可指定開啟網址的方式。
用戶端可以將網址開啟為全尺寸視窗 (如果這是用戶端使用的框架),或疊加層 (例如彈出式視窗)。實作方式取決於用戶端平台功能,如果用戶端不支援所選的值,系統可能會忽略該值。所有用戶端都支援 FULL_SIZE
。
使用 OnClose
可能會導致 OpenAs
遭到忽略;如果用戶端平台無法同時支援所選的兩個值,則 OnClose
會優先採用。
如要呼叫列舉,請呼叫其父項類別、名稱和屬性。例如
CardService.OpenAs.FULL_SIZE
。
屬性
屬性 | 類型 | 說明 |
FULL_SIZE | Enum | 在新視窗或分頁中開啟。預設值。 |
OVERLAY | Enum | 以彈出式視窗等疊加層開啟。 |
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-26 (世界標準時間)。
[null,null,["上次更新時間:2025-07-26 (世界標準時間)。"],[[["\u003cp\u003e\u003ccode\u003eOpenAs\u003c/code\u003e is an enum used to specify how a URL should be opened by the client, either as a full-size window or an overlay.\u003c/p\u003e\n"],["\u003cp\u003eWhile \u003ccode\u003eFULL_SIZE\u003c/code\u003e is supported by all clients, \u003ccode\u003eOVERLAY\u003c/code\u003e support depends on the client platform and might be ignored.\u003c/p\u003e\n"],["\u003cp\u003eUsing \u003ccode\u003eOnClose\u003c/code\u003e may take precedence over \u003ccode\u003eOpenAs\u003c/code\u003e, potentially causing the chosen opening method to be disregarded if the client platform has limitations.\u003c/p\u003e\n"],["\u003cp\u003eTo utilize this enum in your code, use the syntax: \u003ccode\u003eCardService.OpenAs.FULL_SIZE\u003c/code\u003e or \u003ccode\u003eCardService.OpenAs.OVERLAY\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Enum OpenAs\n\nOpenAs\n\nAn enum that specifies how to open a URL.\n\nThe client can open a URL as either a full size window (if that is the frame used by the\nclient), or an overlay (such as a pop-up). The implementation depends on the client platform\ncapabilities, and the value selected may be ignored if the client does not support it. `FULL_SIZE` is supported by all clients.\n\nUsing [OnClose](/apps-script/reference/card-service/on-close) may cause [OpenAs](#) to be ignored; if the client platform cannot\nsupport both selected values together, [OnClose](/apps-script/reference/card-service/on-close) takes precedence.\n\nTo call an enum, you call its parent class, name, and property. For example, `\nCardService.OpenAs.FULL_SIZE`. \n\n### Properties\n\n| Property | Type | Description |\n|-------------|--------|----------------------------------------|\n| `FULL_SIZE` | `Enum` | Open in a full window or tab. Default. |\n| `OVERLAY` | `Enum` | Open as an overlay such as a pop-up. |"]]