ui.url.set
Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Legt den Wert des URL-Fragments der Seite fest. Das Fragment codiert ein Dictionary mit Schlüsseln und Werten. Wenn ein Dictionary als erstes Argument angegeben wird, werden die Schlüssel/Wert-Paare in diesem Dictionary codiert und ersetzen das aktuelle URL-Fragment. Wenn ein Schlüsselstring angegeben wird, wird nur dieser Schlüssel (und sein Wert, das zweite Argument) aktualisiert. Der Rest des URL-Fragments bleibt unverändert.
Nutzung | Ausgabe |
---|
ui.url.set(keyOrDict, value) | |
Argument | Typ | Details |
---|
keyOrDict | Dictionary<Object>|String | Entweder ein Schlüssel zum Aktualisieren eines einzelnen Werts im URL-Fragment oder ein Dictionary mit Schlüssel/Wert-Paaren, die das vorhandene URL-Fragment ersetzen. Wörterbuchwerte müssen vom Typ „String“, „Zahl“ oder „Boolesch“ sein. |
value | Boolesch|Zahl|String, optional | Der neue Wert, der einem einzelnen Schlüssel zugeordnet werden soll. Dies ist erforderlich, wenn das erste Argument ein String ist. Andernfalls wird es ignoriert. |
Sofern nicht anders angegeben, sind die Inhalte dieser Seite unter der Creative Commons Attribution 4.0 License und Codebeispiele unter der Apache 2.0 License lizenziert. Weitere Informationen finden Sie in den Websiterichtlinien von Google Developers. Java ist eine eingetragene Marke von Oracle und/oder seinen Partnern.
Zuletzt aktualisiert: 2025-07-25 (UTC).
[null,null,["Zuletzt aktualisiert: 2025-07-25 (UTC)."],[[["\u003cp\u003e\u003ccode\u003eui.url.set\u003c/code\u003e lets you modify the URL fragment, which stores data as key-value pairs.\u003c/p\u003e\n"],["\u003cp\u003eYou can either replace the entire fragment with a new dictionary or update a single key's value.\u003c/p\u003e\n"],["\u003cp\u003eDictionary values in the URL fragment must be strings, numbers, or booleans.\u003c/p\u003e\n"]]],[],null,["# ui.url.set\n\n\u003cbr /\u003e\n\nSets the value of the page's URL fragment. The fragment encodes a dictionary of keys and values. If a dictionary is supplied as the first argument, the key/value pairs in that dictionary will be encoded and replace the current URL fragment. If a key string is provided, then only that key (and its value, the second argument) are updated, and the rest of the URL fragment is unchanged.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|------------------------------------|---------|\n| `ui.url.set(keyOrDict, `*value*`)` | |\n\n| Argument | Type | Details |\n|-------------|-----------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `keyOrDict` | Dictionary\\\u003cObject\\\u003e\\|String | Either a key to update a single value in the URL fragment, or a dictionary of key/value pairs which will replace the existing URL fragment. Dictionary values must be of type string, number, or boolean. |\n| `value` | Boolean\\|Number\\|String, optional | The new value to associate with a single key. This is required when the first argument is a string and is otherwise ignored. |"]]