方法 PickerBuilder.setOrigin
設定挑選器對話方塊的來源。如果應用程式在 iframe 中執行,來源應設為最頂層頁面的 window.location.protocol + '//' + window.location.host。
簽名
setOrigin(origin: string): PickerBuilder;
詳細資料
參數
名稱 |
類型 |
選用 |
說明 |
origin |
string |
否 |
|
傳回
PickerBuilder
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-11-07 (世界標準時間)。
[null,null,["上次更新時間:2024-11-07 (世界標準時間)。"],[[["Sets the origin of the picker dialog, crucial for applications running in iframes to ensure proper functionality by specifying the top-most page's origin."],["The `setOrigin` method requires a single, mandatory parameter: `origin`, which is a string representing the desired origin."],["This method is not optional, final, protected, or static, offering flexibility in its implementation."],["Using this method returns a `PickerBuilder` instance, enabling further configuration of the picker dialog."]]],["The `setOrigin` function configures the origin of a picker dialog. It requires a string parameter, `origin`, which should be the protocol and host of the top-most page (e.g., `window.location.protocol + '//' + window.location.host`) when the application runs within an iframe. This function, part of the `PickerBuilder`, is not optional, final, protected, or static, and returns a `PickerBuilder` object.\n"]]