LocationHashRoute Op

LocationHashRoute

gives updated information about window.location.hash


<p>this will return information about window.location.hash (the part after the #) in your url.</p> <p>these parts of the url can be changed without reloading the browserwindow and hence may be used to carry state.</p> <p>this adheres to &quot;getstring&quot; syntax for key-value-pairs. having multiple # is also allowed. if key-value-pairs are duplicated the last one in the string &quot;wins&quot;.</p> <p>if you define a route, only parts of the hash that match this route will be considered. use multiple ops and multiple hashes to work with urls like this: &quot;#/scene/1#/track/5&quot;.</p> <p>additionally you may set a route like this &quot;/scene/:number&quot; and the op will extract &quot;5711&quot; from this hash <code>#/scene/5711</code> and store it in the output object as &quot;number&quot;.</p>


Full Name
  • Ops.Website.LocationHashRoute
Visibility
  • Core Op - Official cables op
License
  • MIT
AuthorgithubTest Patches


Example Patch LocationHash Example

how to use the browser location bar to navigate and create deeplinks

Open In Editor

Youtube Video Tutorial

INPUT PORTS


Route (String)

<p>pattern for url and variables (i.e. /scene/:id)</p>

OUTPUT PORTS


Values (Object)

<p>an object of key-value-pairs as extracted from the hash</p>

Changed (Trigger)

<p>fires on change of the hash in the url</p>

Matching (

<i>boolean</i>

Number)


Patches using LocationHashRoute

  • Examples
  • Public
  • My Patches

Changelog


created opuser avatarcables - 2021-03-09 17:08
Ops.User.cables.LocationHash renamed to Ops.Website.LocationHashuser avatarstephan - 2021-03-09 20:40
Ops.Website.LocationHash renamed to Ops.Website.LocationHashRouteuser avatarpandur - 2021-04-27 12:19
bugfixfix crash when using misformed route, show erroruser avatarstephan - 2023-03-29 09:45
bugfixproperly set port value when loading patchuser avatarstephan - 2023-03-29 09:45