This javascript can be used to convert the diswplayed url of a wiki page into json that can be used to represent the lineUp. It is used by the livecode function wikiFrame_Items().
const identifiers = Object.fromEntries(new URLSearchParams(window.location.hash.substr(1)).entries());
This line extracts **key-value pairs** from the **URL fragment (hash)** and stores them as a plain JavaScript object.
# `window.location.hash` * Gets the part of the URL after the `#`. Example: for `https://example.com/#foo=bar&baz=qux`, `window.location.hash` → `"#foo=bar&baz=qux"`
## `.substr(1)` * Removes the leading `#`. → `"foo=bar&baz=qux"`
## `new URLSearchParams(...)` * Parses a query string–style string into an iterable object. → `URLSearchParams { "foo" => "bar", "baz" => "qux" }`
## `.entries()` * Returns an **iterator** of `[key, value]` pairs: → `[["foo", "bar"], ["baz", "qux"]]`
## `Object.fromEntries(...)` * Converts that array of pairs into a plain JavaScript object:
{ foo: "bar", baz: "qux" }
# Final Result If the URL is: ``` https://example.com/#user=alice&id=42 ``` Then: ```js const identifiers = Object.fromEntries( new URLSearchParams("user=alice&id=42").entries() ); ``` Will produce: ```js { user: "alice", id: "42" } ```
# Use Case This pattern is commonly used to: * Pass config or state into an embedded frame * Support bookmarking or linking to pre-set values * Enable lightweight URL-based routing
constant Frame_ItemKeys = "site,slug,origin,title,pageKey,itemId"
constant Frame_ItemKeys = "site,slug,origin,title,pageKey,itemId"