ui.url.set
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
مقدار قطعه URL صفحه را تعیین می کند. قطعه یک فرهنگ لغت از کلیدها و مقادیر را رمزگذاری می کند. اگر یک دیکشنری به عنوان اولین آرگومان ارائه شود، جفتهای کلید/مقدار در آن فرهنگ لغت کدگذاری شده و جایگزین قطعه URL فعلی میشوند. اگر یک رشته کلید ارائه شود، تنها آن کلید (و مقدار آن، آرگومان دوم) بهروزرسانی میشود و بقیه قطعه URL بدون تغییر میماند.
استفاده | برمی گرداند | ui.url.set(keyOrDict, value ) | |
استدلال | تایپ کنید | جزئیات | keyOrDict | دیکشنری<Object>|رشته | یا کلیدی برای بهروزرسانی یک مقدار در قطعه URL، یا فرهنگ لغت جفتهای کلید/مقدار که جایگزین قطعه URL موجود میشود. مقادیر فرهنگ لغت باید از نوع رشته، عدد یا بولی باشد. |
value | بولی | شماره | رشته، اختیاری | مقدار جدید برای مرتبط کردن با یک کلید. زمانی که آرگومان اول یک رشته باشد و در غیر این صورت نادیده گرفته شود، این مورد ضروری است. |
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی."],[[["\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. |"]]